diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a7f5f51 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Deploy versioned & latest + +on: + release: + types: [published] + +jobs: + deploy-base: + name: Deploy base image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + shell: bash + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build base image + run: docker build -t ghcr.io/mu-editor/mu-appimage:latest . + - name: Tag same base image with the versioned tag + run: docker tag ghcr.io/mu-editor/mu-appimage:latest ghcr.io/mu-editor/mu-appimage:${{ steps.get_version.outputs.VERSION }} + - name: Push base images to ghcr.io + run: | + docker push ghcr.io/mu-editor/mu-appimage:${{ steps.get_version.outputs.VERSION }} + docker push ghcr.io/mu-editor/mu-appimage:latest