Push Release Docker Images #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Push Release Docker Images' | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
paths: | |
- 'src/**' | |
- 'server/**' | |
- 'prisma/**' | |
- '.github/**' | |
- 'Dockerfile' | |
workflow_dispatch: | |
jobs: | |
push: | |
name: Push Release Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Get version | |
id: version | |
run: | | |
echo "zipline_version=$(jq .version package.json -r)" >> $GITHUB_OUTPUT | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/diced/zipline:latest | |
ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }} | |
${{ secrets.DOCKERHUB_USERNAME }}/zipline:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |