-
Notifications
You must be signed in to change notification settings - Fork 246
64 lines (57 loc) · 2.44 KB
/
dagger_on_github.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
name: "Dagger on GitHub"
on:
workflow_call:
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: "Checkout code..."
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
cache-dependency-path: "magefiles/go.sum"
- name: "Build, test & publish..."
env:
IMAGE_OWNER: "${{ vars.IMAGE_OWNER }}"
GHCR_USERNAME: "${{ github.actor }}"
GHCR_PASSWORD: "${{ secrets.GHCR_PASSWORD }}"
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
R2_API_HOST: "${{ secrets.R2_API_HOST }}"
R2_ACCESS_KEY_ID: "${{ secrets.R2_ACCESS_KEY_ID }}"
R2_SECRET_ACCESS_KEY: "${{ secrets.R2_SECRET_ACCESS_KEY }}"
R2_ASSETS_BUCKET: "${{ env.R2_ASSETS_BUCKET }}"
OBAN_KEY_FINGERPRINT: "${{ secrets.OBAN_KEY_FINGERPRINT }}"
OBAN_LICENSE_KEY: "${{ secrets.OBAN_LICENSE_KEY }}"
run: |
cd magefiles
go run main.go -w ../ ci
- name: "Deploy..."
if: ${{ github.repository == 'thechangelog/changelog.com' && github.ref_name == 'master' }}
env:
IMAGE_OWNER: "${{ vars.IMAGE_OWNER }}"
GHCR_USERNAME: "${{ github.actor }}"
GHCR_PASSWORD: "${{ secrets.GHCR_PASSWORD }}"
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
R2_API_HOST: "${{ secrets.R2_API_HOST }}"
R2_ACCESS_KEY_ID: "${{ secrets.R2_ACCESS_KEY_ID }}"
R2_SECRET_ACCESS_KEY: "${{ secrets.R2_SECRET_ACCESS_KEY }}"
R2_ASSETS_BUCKET: "${{ env.R2_ASSETS_BUCKET }}"
OBAN_KEY_FINGERPRINT: "${{ secrets.OBAN_KEY_FINGERPRINT }}"
OBAN_LICENSE_KEY: "${{ secrets.OBAN_LICENSE_KEY }}"
run: |
cd magefiles
go run main.go -w ../ cd
- name: "Announce deploy in #kaizen Zulip..."
if: ${{ github.repository == 'thechangelog/changelog.com' && github.ref_name == 'master' }}
uses: zulip/github-actions-zulip/send-message@v1
with:
api-key: ${{ secrets.ZULIP_BOT_API_KEY }}
email: "[email protected]"
organization-url: "https://changelog.zulipchat.com"
to: "kaizen"
type: "stream"
topic: "Code deploys"
content: |
${{ github.actor }} just successfully deployed [${{ env.SHORT_SHA }}](https://github.com/thechangelog/changelog.com/commit/${{ github.sha }}):
> ${{ github.event.commits[0].message }}