-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (43 loc) · 1.48 KB
/
fileserver.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
name: File server build & image publish
run-name: Deploy file server ${{ github.ref }}
on:
push:
branches:
- main
paths:
- "Cargo.toml"
- "crates/file-server/**"
workflow_dispatch: {}
env:
PROJECT_ID: "parity-zombienet"
GCR_REGISTRY: "europe-west3-docker.pkg.dev"
GCR_REPOSITORY: "zombienet-public-images"
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v2.0.1
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ env.PROJECT_ID }}
export_default_credentials: true
- name: Login to GCP
uses: google-github-actions/auth@v2.0.1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Artifact registry authentication
run: |
gcloud auth configure-docker ${{ env.GCR_REGISTRY }}
- name: Build, tag, and push image to GCP Artifact registry
id: build-image
env:
IMAGE: "${{ env.GCR_REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.GCR_REPOSITORY }}/zombienet-file-server"
run: |
docker build -t $IMAGE:${{ github.sha }} -f ./crates/file-server/Dockerfile .
docker tag $IMAGE:${{ github.sha }} $IMAGE:latest
docker push --all-tags $IMAGE
echo "image=$IMAGE:${{ github.sha }}" >> $GITHUB_OUTPUT
echo "image=$IMAGE:latest" >> $GITHUB_OUTPUT