-
Notifications
You must be signed in to change notification settings - Fork 205
36 lines (36 loc) · 1.19 KB
/
push-xc-admin-frontend-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: xc_admin_frontend Docker Image
on:
pull:
branches: [main]
push:
branches: [main]
paths: [governance/xc_admin/**]
permissions:
contents: read
id-token: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: pyth-network/xc-admin-frontend
jobs:
xc-admin-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set image tag to timestamp and shortened commit hash
run: |
SHORT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
TIMESTAMP=$(date +%s)
echo "IMAGE_TAG=${TIMESTAMP}-${SHORT_HASH}" >> "${GITHUB_ENV}"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push server docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: "./governance/xc_admin/packages/xc_admin_frontend/Dockerfile"
push: github.ref == 'refs/heads/main'
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$IMAGE_TAG