-
-
Notifications
You must be signed in to change notification settings - Fork 14
62 lines (51 loc) · 1.58 KB
/
deploy.yaml
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 GAE
on:
push:
branches:
- master
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Authorize to Google Cloud
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_CREDENTIALS_JSON }}'
- name: Deploy to App Engine
id: deploy
uses: google-github-actions/deploy-appengine@v2
- name: cURL Test
run: curl "${{ steps.deploy.outputs.url }}"
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v2'
- name: Delete Old App Versions
# delete all but latest 5 versions
run: |
gcloud app versions list \
--format="value(version.id)" \
--sort-by="~version.createTime" \
| tail -n +5 \
| xargs -r gcloud app versions delete --quiet
# make sure we didn't delete the current version
- name: cURL Test
run: curl "${{ steps.deploy.outputs.url }}"
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
cache-from: ghcr.io/${{ github.repository }}:latest
cache-to: type=inline
tags: ghcr.io/${{ github.repository }}:latest