Update docker.yml

This commit is contained in:
Nicolas Chan 2021-06-03 21:46:43 -07:00 committed by GitHub
parent 7a2e25ef5a
commit f5a2c4ac50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,9 @@ name: Docker
on: on:
push: push:
branches: branches:
- master - master
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:
@ -51,6 +53,12 @@ jobs:
- name: Build the Docker image - name: Build the Docker image
run: | run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker build . --file Dockerfile --tag ghcr.io/nicolaschan/minecraft-backup:$GITHUB_SHA --tag ghcr.io/nicolaschan/minecraft-backup:latest docker build . --file Dockerfile --tag ghcr.io/nicolaschan/minecraft-backup:$GITHUB_REF --tag ghcr.io/nicolaschan/minecraft-backup:latest
docker push ghcr.io/nicolaschan/minecraft-backup:$GITHUB_SHA docker push ghcr.io/nicolaschan/minecraft-backup:$GITHUB_REF
docker push ghcr.io/nicolaschan/minecraft-backup:latest docker push ghcr.io/nicolaschan/minecraft-backup:latest
- name: Create Release
uses: ncipollo/release-action@v1.8.6
with:
artifacts: "backup.sh"
token: ${{ secrets.GITHUB_TOKEN }}