forked from ppy/osu-web
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (111 loc) · 3.57 KB
/
pack.yml
File metadata and controls
115 lines (111 loc) · 3.57 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build and publish
on:
push:
branches:
- master
- private-staging
tags:
- '*'
jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
pppy/osu-web
# generate Docker tags based on the following events/attributes
# on tag event: tag using git tag, and as latest if the tag doesn't contain hyphens (pre-releases)
# on push event: tag using git sha, branch name and as latest-dev
tags: |
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && !contains(github.ref_name, '-') }}
type=raw,value=latest-dev,enable=${{ github.ref_type == 'branch' }}
type=raw,value=${{ github.ref_name }}
type=raw,value=${{ github.sha }},enable=${{ github.ref_type == 'branch' }}
flavor: |
latest=false
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
build-args: |
"APP_URL=https://osu.ppy.sh"
"DOCS_URL=https://osu.ppy.sh/docs/"
"GIT_SHA=osu-web@${{ (github.ref_type == 'tag' && github.ref_name) || github.sha }}"
context: .
file: ./Dockerfile.deployment
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_to_production:
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- push_to_registry
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.KUBERNETES_CONFIG_REPO_ACCESS_TOKEN }}
repository: ppy/osu-kubernetes-config
event-type: osu-web-deploy
-
name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ppy
SENTRY_PROJECT: osu-web
SENTRY_URL: https://sentry.ppy.sh/
with:
environment: production
version: osu-web@${{ github.ref_name }}
push_to_staging:
if: ${{ github.ref_type == 'branch' && github.ref_name == 'master' }}
runs-on: ubuntu-latest
needs:
- push_to_registry
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.KUBERNETES_CONFIG_REPO_ACCESS_TOKEN }}
repository: ppy/osu-kubernetes-config
event-type: dev-ppy-sh-deploy
client-payload: '{ "values": { "image": { "tag": "${{ github.sha }}" } } }'
-
name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ppy
SENTRY_PROJECT: osu-web
SENTRY_URL: https://sentry.ppy.sh/
with:
environment: staging
version: osu-web@${{ github.sha }}