Skip to content

Merge branch 'fix-login-with-ref-code-param' #93

Merge branch 'fix-login-with-ref-code-param'

Merge branch 'fix-login-with-ref-code-param' #93

Workflow file for this run

on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
name: Build and push docker
env:
REGISTRY: ghcr.io
IMAGE_NAME: blockscout/blockscout-merits-website
jobs:
push:
name: Docker build and docker push
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions-ecosystem/action-regex-match@v2
id: regex
with:
text: ${{ github.ref }}
regex: '^(refs\/tags\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$'
- name: Extract tag name
id: tags_extractor
run: |
t=${{ steps.regex.outputs.group2 }}
m=${{ steps.regex.outputs.group4 }}
(if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT
- name: Setup repo
uses: blockscout/actions/.github/actions/setup-multiarch-buildx@main
id: setup
with:
docker-image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
docker-remote-multi-platform: true
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: "Dockerfile"
push: ${{ steps.tags_extractor.outputs.tags != '' }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache
cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }}
tags: ${{ steps.tags_extractor.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
linux/arm64/v8
deploy_stage:
name: Deploy stg instance
needs: push
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Get Vault credentials
id: retrieve-vault-secrets
uses: hashicorp/[email protected]
with:
url: https://vault.k8s.blockscout.com
role: ci-dev
path: github-jwt
method: jwt
tlsSkipVerify: false
exportToken: true
secrets: |
ci/data/dev/github token | WORKFLOW_TRIGGER_TOKEN ;
- name: Trigger deploy
uses: convictional/[email protected]
with:
owner: blockscout
repo: deployment-values
github_token: ${{ env.WORKFLOW_TRIGGER_TOKEN }}
workflow_file_name: deploy_services.yaml
ref: main
wait_interval: 30
client_payload: '{ "instance": "points", "globalEnv": "testing"}'