Bump docker/setup-buildx-action from 2 to 3 (#8) #53
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: CI/CD | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
cicd: | |
name: CI/CD | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repo at current context | |
uses: actions/checkout@v4 | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run static code tests | |
run: | | |
task test:static | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: bcbrookman/buoy | |
tags: | | |
type=raw, value=latest | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
load: true | |
tags: buoy:test | |
- name: Run and test that the image works | |
run: | | |
docker run --name buoy -d buoy:test | |
docker exec --tty buoy flask --version | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
if: github.event_name != 'pull_request' | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push Docker image to DockerHub | |
uses: docker/build-push-action@v6 | |
if: github.event_name != 'pull_request' | |
with: | |
context: ./ | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |