Skip to content

update build strategy #9

update build strategy

update build strategy #9

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Docker image
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: martinfjr/personal-site
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=edge,priority=900,branch=$repo.default_branch
type=ref,enable=true,priority=600,prefix=,suffix=,event=tag
type=ref,enable=true,priority=600,prefix=pr-,suffix=,event=pr
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
push: true

Check failure on line 55 in .github/workflows/docker-push.yml

View workflow run for this annotation

GitHub Actions / Docker image

Invalid workflow file

The workflow is not valid. .github/workflows/docker-push.yml (Line: 55, Col: 11): 'push' is already defined
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}