forked from Netflix/conductor
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 2.12 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: build
on:
push:
branches:
- master
- staging
- develop
- sandbox
jobs:
get-environment-name:
name: "Extract environment name"
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.extract.outputs.environment }}
steps:
- id: extract
run: echo "::set-output name=environment::$(echo $GITHUB_REF | sed -e '/^refs\/heads\/\(.*\)$/!d;s//\1/')"
- env:
EXTRACTED: ${{ steps.extract.outputs.environment }}
run: 'echo "Extracted environment name: $EXTRACTED"'
build:
runs-on: ubuntu-latest
needs:
- get-environment-name
environment: ${{ needs.get-environment-name.outputs.environment }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Auth gcloud
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GCP_SERVICE_CREDENTIALS }}
- name: Setup gcloud
uses: 'google-github-actions/setup-gcloud@v0'
- name: Configure docker
run: gcloud auth configure-docker ${{ secrets.GCP_REGISTRY_URL }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and push
run: |
docker buildx build \
-f docker/server/Dockerfile . \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.GCP_REGISTRY_URL }}/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_REGISTRY_REPO }}/${{ secrets.GCP_APP_NAME }}:${{ github.sha }} \
--tag ${{ secrets.GCP_REGISTRY_URL }}/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_REGISTRY_REPO }}/${{ secrets.GCP_APP_NAME }}:latest \
--push