-
Notifications
You must be signed in to change notification settings - Fork 230
53 lines (43 loc) · 1.39 KB
/
build.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
GITHUB_REF_NAME: "$(echo ${{ github.ref_name }} | tr '//' '-')"
jobs:
build-docker:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: setup-git-credentials
uses: de-vri-es/[email protected]
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6
- name: Git Hash
run: |
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> ${GITHUB_ENV}
echo "WORKSPACE_DIR=$(pwd)" >> ${GITHUB_ENV}
- name: set-branch-name
uses: ./.github/actions/set-branch-name
with:
github_ref: "${{github.ref}}"
github_event: "${{ github.event_name }}"
github_head_ref: "${{ github.event.pull_request.head.ref }}"
github_commit_sha: "${{ env.GIT_HASH }}"
current_branch_name: "${{ steps.branch-name.outputs.current_branch }}"
- name: Build, tag, and push docker images
uses: ./.github/actions/build-docker-images
with:
DOCKER_FILENAME: Dockerfile
REPOSITORY_NAME: zetachain
IMAGE_TAG: ${{ env.TAG_NAME }}
GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }}
GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}