Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Updates password for Login to GitHub Container Registry #1040

Updates password for Login to GitHub Container Registry

Updates password for Login to GitHub Container Registry #1040

Workflow file for this run

---
name: Main
on:
push:
branches:
- 'release/**'
- 'master'
- 'stg'
pull_request:
paths-ignore:
- '.github/**'
jobs:
node-tests-and-build:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Ensure yarn is installed on self-hosted
run: npm install -g yarn
- name: Install dependencies
run: yarn
- name: Lint
run: yarn lint
- name: Run tests
run: yarn test
- name: Build
run: yarn build
docker-release:
runs-on: self-hosted
needs:
- node-tests-and-build
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stg' || startsWith(github.ref, 'refs/heads/release') || github.ref == 'refs/heads/wip/mockup'
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get branch name, git commit hash and current time in secs
id: vars
shell: bash
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-' )" >> $GITHUB_OUTPUT
echo "GIT_HASH_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "DATE_IN_SECS=$(date +%s)" >> $GITHUB_OUTPUT
- name: Push to ghcr.io (main, static)
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/master'
with:
context: .
file: ./Dockerfile.static
platforms: linux/amd64
push: true
build-args: |
COMMIT_SHA=${{ steps.vars.outputs.GIT_HASH_SHORT }}
VOCDONI_ENVIRONMENT=dev
ETH_NETWORK_ID=goerli
tags: |
ghcr.io/vocdoni/${{ github.event.repository.name }}:${{ steps.vars.outputs.BRANCH_NAME }}-static
ghcr.io/vocdoni/${{ github.event.repository.name }}:commit-${{ steps.vars.outputs.GIT_HASH_SHORT }}
ghcr.io/vocdoni/${{ github.event.repository.name }}:${{ steps.vars.outputs.BRANCH_NAME }}-static-${{ steps.vars.outputs.DATE_IN_SECS }}
- name: Push to ghcr.io (stg, static)
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/stg'
with:
context: .
file: ./Dockerfile.static
platforms: linux/amd64
push: true
build-args: |
COMMIT_SHA=${{ steps.vars.outputs.GIT_HASH_SHORT }}
VOCDONI_ENVIRONMENT=stg
ETH_NETWORK_ID=goerli
tags: |
ghcr.io/vocdoni/${{ github.event.repository.name }}:${{ steps.vars.outputs.BRANCH_NAME }}
ghcr.io/vocdoni/${{ github.event.repository.name }}:commit-${{ steps.vars.outputs.GIT_HASH_SHORT }}
ghcr.io/vocdoni/${{ github.event.repository.name }}:${{ steps.vars.outputs.BRANCH_NAME }}-static-${{ steps.vars.outputs.DATE_IN_SECS }}
- name: Push to ghcr.io (prod, static)
uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/heads/release')
with:
context: .
file: ./Dockerfile.static
platforms: linux/amd64
push: true
build-args: |
COMMIT_SHA=${{ steps.vars.outputs.GIT_HASH_SHORT }}
VOCDONI_ENVIRONMENT=prod
ETH_NETWORK_ID=xdai
tags: |
ghcr.io/vocdoni/${{ github.event.repository.name }}:${{ steps.vars.outputs.BRANCH_NAME }}
ghcr.io/vocdoni/${{ github.event.repository.name }}:commit-${{ steps.vars.outputs.GIT_HASH_SHORT }}
ghcr.io/vocdoni/${{ github.event.repository.name }}:${{ steps.vars.outputs.BRANCH_NAME }}-static-${{ steps.vars.outputs.DATE_IN_SECS }}