Skip to content

Docker build and release #33

Docker build and release

Docker build and release #33

Workflow file for this run

name: Docker build and release
on:
workflow_run:
workflows: ["Server build"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and tag Docker image
run: |
git fetch --tags
version=$(echo $(git tag --sort=-creatordate | head -n 1))
version=${version#v}
docker buildx build -t ${{ secrets.DOCKER_USERNAME }}/photron:$version . --platform linux/arm64/v8,linux/amd64 --push
docker buildx imagetools create -t docker.io/${{ secrets.DOCKER_USERNAME }}/photron:latest docker.io/${{ secrets.DOCKER_USERNAME }}/photron:$version