# This is a basic workflow to help you get started with Actions name: Release # Controls when the action will run. on: workflow_run: workflows: ["CI"] branches: [master] types: [completed] tags: ['v*'] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: release: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: submodules: 'recursive' - name: Create Release uses: ncipollo/release-action@v1.8.6 with: artifacts: "backup.sh" token: ${{ secrets.GITHUB_TOKEN }} docker: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: submodules: 'recursive' - name: Build Docker image run: | docker build . --file Dockerfile --tag ghcr.io/nicolaschan/minecraft-backup:${GITHUB_REF#refs/*/} --tag ghcr.io/nicolaschan/minecraft-backup:latest - name: Publish Docker image run: | echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin docker push ghcr.io/nicolaschan/minecraft-backup:${GITHUB_REF#refs/*/} docker push ghcr.io/nicolaschan/minecraft-backup:latest