Skip to content

chore(deps): update docker/build-push-action action to v7 (#1409) #156

chore(deps): update docker/build-push-action action to v7 (#1409)

chore(deps): update docker/build-push-action action to v7 (#1409) #156

Workflow file for this run

# name of the action
name: prerelease
# trigger on push events with `v*` in tag
on:
push:
tags:
- "v*"
permissions:
contents: read
# pipeline to execute
jobs:
prerelease:
runs-on: ubuntu-latest
steps:
- name: clone
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# ensures we fetch tag history for the repository
fetch-depth: 0
- name: install go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
# use version from go.mod file
go-version-file: "go.mod"
cache: true
check-latest: true
- name: setup
run: |
# setup git tag in Actions environment
echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: build
env:
GOOS: linux
CGO_ENABLED: "1"
run: |
make build-static-ci
- name: login to dockerhub
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: extract metadata
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: target/vela-server
tags: |
# only on push tag, "raw" because {{version}} strips "v" prefix
type=semver,pattern={{raw}}
- name: build and push image
id: push
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
prerelease_alpine:
runs-on: ubuntu-latest
steps:
- name: clone
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# ensures we fetch tag history for the repository
fetch-depth: 0
- name: install go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
# use version from go.mod file
go-version-file: "go.mod"
cache: true
check-latest: true
- name: setup
run: |
# setup git tag in Actions environment
echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: build
env:
GOOS: linux
CGO_ENABLED: "1"
run: |
make build-static-ci
- name: login to dockerhub
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: extract metadata
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with:
images: target/vela-server
tags: |
# only on push tag, "raw" because {{version}} strips "v" prefix
type=semver,pattern={{raw}},suffix=-alpine
- name: build and push image
id: push
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: ./Dockerfile-alpine
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}