Add pubish-docker-images.yml #1
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: Publish | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' | |
workflow_dispatch: | |
jobs: | |
get_dist_tag: | |
runs-on: ubuntu-latest | |
outputs: | |
DIST_TAG: ${{ steps.get_tag.outputs.DIST_TAG }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get the tag name | |
id: get_tag | |
run: | | |
tag=$(echo ${GITHUB_REF/refs\/tags\//} | cut -c 2-) | |
dist_tag=$([[ $tag =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo latest || echo "") | |
dist_tag=$([[ $tag =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]] && echo rc || echo $dist_tag) | |
[ -z "$dist_tag" ] && echo "Distribution tag is not set to latest nor to rc" && exit 1 | |
echo ::set-output name=DIST_TAG::$dist_tag | |
shell: bash | |
publish: | |
runs-on: ubuntu-20.04 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v0' | |
with: | |
workload_identity_provider: projects/1004240933630/locations/global/workloadIdentityPools/github-pool/providers/github-provider | |
service_account: [email protected] | |
- name: auth docker | |
run: gcloud auth configure-docker | |
- name: build and push testnet docker images | |
run: ./build-docker-images.sh "testnet" ${{ needs.get_dist_tag.outputs.DIST_TAG }} true |