Docker Release Build #35
Workflow file for this run
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 Release Build | |
on: | |
release: | |
types: [released, prereleased] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
run: | | |
docker build \ | |
--label commit=$GITHUB_SHA \ | |
--label build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ | |
--label tag=${GITHUB_REF##*/} \ | |
--build-arg BASE_IMAGE=node:20-alpine3.19 \ | |
--build-arg BUILD_IMAGE=node:20-alpine3.19 \ | |
--tag ghcr.io/hyperledger/firefly-tokens-erc1155:${GITHUB_REF##*/} \ | |
--tag ghcr.io/hyperledger/firefly-tokens-erc1155:head \ | |
. | |
- name: Tag release | |
if: github.event.action == 'released' | |
run: docker tag ghcr.io/hyperledger/firefly-tokens-erc1155:${GITHUB_REF##*/} ghcr.io/hyperledger/firefly-tokens-erc1155:latest | |
- name: Push docker image | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker push ghcr.io/hyperledger/firefly-tokens-erc1155:${GITHUB_REF##*/} | |
- name: Push head tag | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker push ghcr.io/hyperledger/firefly-tokens-erc1155:head | |
- name: Push latest tag | |
if: github.event.action == 'released' | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker push ghcr.io/hyperledger/firefly-tokens-erc1155:latest |