Merge pull request #99 from dkusidlo/dependabot/github_actions/docker… #73
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: Docker Build & Push | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
update_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get latest tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- uses: release-drafter/release-drafter@v6 | |
with: | |
config-name: release-drafter.yml | |
disable-autolabeler: true | |
publish: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
needs: update_release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# - name: Docker meta | |
# id: meta | |
# uses: docker/metadata-action@v5 | |
# with: | |
# images: | | |
# dkusidlo/alpine-netops | |
# # generate Docker tags based on the following events/attributes | |
# tags: | | |
# type=schedule | |
# type=ref,event=branch | |
# type=ref,event=tag | |
# type=ref,event=pr | |
# type=semver,pattern={{version}} | |
# type=semver,pattern={{major}}.{{minor}} | |
# type=semver,pattern={{major}} | |
# flavor: | | |
# latest=false | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
id: build | |
with: | |
install: true | |
- name: Get latest tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/[email protected] | |
with: | |
# provenance: false | |
context: . | |
build-args: ARCH=arm32v7 ARCH=amd64 | |
# file: Dockerfile | |
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 | |
push: true | |
# tags: ${{ steps.meta.outputs.tags }} | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/alpine-netops:${{ steps.get-latest-tag.outputs.tag }} , ${{ secrets.DOCKER_HUB_USERNAME }}/alpine-netops:latest |