-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (57 loc) · 1.72 KB
/
deploy.yml
File metadata and controls
62 lines (57 loc) · 1.72 KB
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
name: "Deploy to Production Registry"
on:
release:
types: [published]
# GITHUB_REF should be the tag - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
env:
DEV_REGISTRY: ghcr.io/noaa-gsl/mats/development
PROD_REGISTRY: ghcr.io/noaa-gsl/mats/production
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
deploy: # List of apps to deploy
- airQuality
- cb-metar
- ceil-vis
- ceil-vis15
- ensemble
- home
- landuse
- precipAccum
- precipGauge
- precipitation1hr
- ptype
- radar
- scorecard
- surface
- surfrad
- upperair
steps:
- name: Create lowercase app names
# Docker tags must be lowercase
env:
APP: '${{ matrix.deploy }}'
run: |
echo "APP_NAME=${APP,,}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull image
run: |
docker pull ${{ env.DEV_REGISTRY }}/${{ env.APP_NAME }}:${GITHUB_REF#refs/tags/}
- name: Retag image
run: |
docker tag ${{ env.DEV_REGISTRY }}/${{ env.APP_NAME }}:${GITHUB_REF#refs/tags/} \
${{ env.PROD_REGISTRY }}/${{ env.APP_NAME }}:${GITHUB_REF#refs/tags/}
- name: Push image
run: |
docker push ${{ env.PROD_REGISTRY }}/${{ env.APP_NAME }}:${GITHUB_REF#refs/tags/}