Skip to content

fix(cicd): try to fix workflow #26

fix(cicd): try to fix workflow

fix(cicd): try to fix workflow #26

Workflow file for this run

name: Docker build and release
on:
workflow_run:
workflows: ["Server build"]
types:
- completed
push:
branches:
- main
paths:
- '.github/workflows/docker.yml'
- 'Dockerfile'
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))
docker buildx build -t ${{ secrets.DOCKER_USERNAME }}/photron:$version . --platform linux/arm64/v8,linux/amd64
docker tag ${{ secrets.DOCKER_USERNAME }}/photron:$version ${{ secrets.DOCKER_USERNAME }}/photron:latest
- name: Push image to Docker Hub
run: |
version=$(echo $(git tag --sort=-creatordate | head -n 1))
docker push ${{ secrets.DOCKER_USERNAME }}/photron:$version
docker push ${{ secrets.DOCKER_USERNAME }}/photron:latest