generated from cheqd/.github
-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (51 loc) · 1.63 KB
/
staging.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
name: "Deploy"
on:
workflow_call:
defaults:
run:
shell: bash
jobs:
deploy-staging:
name: "Staging Deploy"
runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ github.repository }}
environment:
name: staging
url: https://resolver-staging.cheqd.net
steps:
- name: Install DigitalOcean CLI
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Login to DOCR
run: doctl registry login --expiry-seconds 600
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: did-resolver-staging
- name: Load Docker image
run: docker image load --input did-resolver-staging.tar
- name: Push staging image to DOCR
run: docker image push --all-tags registry.digitalocean.com/${{ env.IMAGE_NAME }}
release-staging:
name: "Release Staging Docker image"
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'develop' }}
env:
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: did-resolver-staging
- name: Load Docker image
run: docker image load --input did-resolver-staging.tar
- name: Push image to GitHub Container Registry
run: docker image push --all-tags ghcr.io/${{ env.IMAGE_NAME }}