Skip to content

Commit 2d822a1

Browse files
committed
Merge branch 'main' into 20-move-weather-symbol-code-to-separate-repo
2 parents 33fecba + 41ab53a commit 2d822a1

3 files changed

Lines changed: 70 additions & 74 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build
33
on:
44
push:
55
branches: ["**"]
6-
tags: ["**"]
76
pull_request:
87

98
jobs:
@@ -19,73 +18,21 @@ jobs:
1918
- moxfrontend
2019
- rawdataforecaster
2120
- xmlfrontend
22-
env:
23-
ACR_IMAGE: fortiregistry.azurecr.io/${{ matrix.service }}:${{ github.run_id }}
24-
GHCR_IMAGE: ghcr.io/${{ github.repository }}/${{ matrix.service }}:${{ github.run_id }}
2521
steps:
2622
- uses: actions/checkout@v4
27-
- name: Login to ACR
28-
uses: docker/login-action@v4
29-
with:
30-
registry: fortiregistry.azurecr.io
31-
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
32-
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
33-
- name: Login to GitHub Container Registry
34-
uses: docker/login-action@v4
35-
with:
36-
registry: ghcr.io
37-
username: ${{ github.actor }}
38-
password: ${{ secrets.GITHUB_TOKEN }}
39-
- name: Build and push
40-
run: |
41-
docker build -t $ACR_IMAGE -t $GHCR_IMAGE -f ${{ matrix.service }}/build/package/Dockerfile .
42-
docker push $ACR_IMAGE
43-
docker push $GHCR_IMAGE
44-
45-
fortiup:
46-
name: Build fortiup
47-
runs-on: ubuntu-latest
48-
if: startsWith(github.ref, 'refs/tags/fortiup')
49-
steps:
50-
- uses: actions/checkout@v4
51-
52-
# Produce a filesystem-safe slug from the tag name (e.g. fortiup/0.4.0 -> fortiup-0-4-0),
53-
# mirroring GitLab's $CI_COMMIT_REF_SLUG behaviour.
54-
- name: Create ref slug
55-
id: slug
56-
run: echo "slug=$(echo '${{ github.ref_name }}' | tr '/.' '-')" >> "$GITHUB_OUTPUT"
57-
- name: Login to ACR
58-
uses: docker/login-action@v4
59-
with:
60-
registry: fortiregistry.azurecr.io
61-
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
62-
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
63-
- name: Build image and extract binary
64-
env:
65-
ACR_IMAGE: fortiregistry.azurecr.io/fortiup:${{ github.run_id }}
66-
run: |
67-
docker build -t $ACR_IMAGE -f fortiup/build/package/Dockerfile .
68-
docker push $ACR_IMAGE
69-
docker run --rm --entrypoint cat $ACR_IMAGE /usr/local/bin/fortiup > ${{ steps.slug.outputs.slug }}
70-
chmod +x ${{ steps.slug.outputs.slug }}
71-
72-
- name: Upload binary artifact
73-
uses: actions/upload-artifact@v4
74-
with:
75-
name: ${{ steps.slug.outputs.slug }}
76-
path: ${{ steps.slug.outputs.slug }}
23+
- name: Build
24+
run: docker build -f ${{ matrix.service }}/build/package/Dockerfile .
7725

7826
vulncheck:
7927
name: Vulnerability check
8028
needs: [build]
8129
runs-on: ubuntu-latest
8230
container:
83-
# Requires AZURE_REGISTRY_USERNAME and AZURE_REGISTRY_PASSWORD secrets to pull the image.
8431
# Build/push the devcontainer image via the devcontainer.yml workflow when it changes.
85-
image: fortiregistry.azurecr.io/devcontainer:latest
32+
image: ghcr.io/${{ github.repository }}/devcontainer:latest
8633
credentials:
87-
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
88-
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
8936
steps:
9037
- uses: actions/checkout@v4
9138
- run: govulncheck ./...

.github/workflows/devcontainer.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,20 @@ jobs:
77
devcontainer:
88
name: Build and push devcontainer image
99
runs-on: ubuntu-latest
10-
env:
11-
ACR_IMAGE: fortiregistry.azurecr.io/devcontainer:latest
12-
GHCR_IMAGE: ghcr.io/${{ github.repository }}/devcontainer:latest
1310
steps:
1411
- uses: actions/checkout@v4
15-
- name: Login to ACR
16-
uses: docker/login-action@v4
17-
with:
18-
registry: fortiregistry.azurecr.io
19-
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
20-
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
12+
2113
- name: Login to GitHub Container Registry
2214
uses: docker/login-action@v4
2315
with:
2416
registry: ghcr.io
2517
username: ${{ github.actor }}
2618
password: ${{ secrets.GITHUB_TOKEN }}
19+
2720
- name: Build and push
28-
run: |
29-
docker build \
30-
-t $ACR_IMAGE \
31-
-t $GHCR_IMAGE \
32-
-f .devcontainer/Dockerfile .
33-
docker push $ACR_IMAGE
34-
docker push $GHCR_IMAGE
21+
uses: docker/build-push-action@v6
22+
with:
23+
context: .
24+
file: .devcontainer/Dockerfile
25+
push: true
26+
tags: ghcr.io/${{ github.repository }}/devcontainer:latest

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
name: Release ${{ matrix.service }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
service:
15+
- correctedforecaster
16+
- healthz
17+
- jsonfrontend
18+
- moxfrontend
19+
- rawdataforecaster
20+
- xmlfrontend
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Docker metadata
25+
id: meta
26+
uses: docker/metadata-action@v5
27+
with:
28+
images: |
29+
fortiregistry.azurecr.io/${{ matrix.service }}
30+
ghcr.io/${{ github.repository }}/${{ matrix.service }}
31+
tags: |
32+
type=semver,pattern=v{{major}}
33+
type=semver,pattern=v{{major}}.{{minor}}
34+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
35+
36+
- name: Login to ACR
37+
uses: docker/login-action@v4
38+
with:
39+
registry: fortiregistry.azurecr.io
40+
username: ${{ secrets.AZURE_REGISTRY_USERNAME }}
41+
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}
42+
43+
- name: Login to GitHub Container Registry
44+
uses: docker/login-action@v4
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Build and push
51+
uses: docker/build-push-action@v6
52+
with:
53+
context: .
54+
file: ${{ matrix.service }}/build/package/Dockerfile
55+
push: true
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)