-
Notifications
You must be signed in to change notification settings - Fork 9
76 lines (62 loc) · 1.96 KB
/
blog-deploy.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
65
66
67
68
69
70
71
72
73
74
75
76
name: 'Blog build, push and deploy'
on:
push:
branches: [ master, feature/198-blog-deploy-workflow ]
paths:
- 'apps/blog/**'
- '.deploy/blog.deploy.yml'
- '.docker/Blog_Dockerfile*'
- '.github/workflows/blog-deploy.yml'
env:
AWS_REGION: 'eu-north-1'
jobs:
build-blog-image:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760
- name: Docker login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/arm64
push: true
tags: |
ghcr.io/memebattle/blog:${{ github.sha }}
ghcr.io/memebattle/blog:latest
context: '.'
file: '.docker/Blog_Dockerfile'
cache-from: type=gha,scope=$GITHUB_REF_NAME-blog
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-blog
deploy:
needs: [build-blog-image]
runs-on: ubuntu-20.04
environment:
name: Blog-production
url: https://blog.mems.fun
steps:
- uses: actions/checkout@v3
name: Checkout
- uses: ./.github/actions/deploy-to-swarm
name: Deploy to swarm lambda
with:
path-to-stack: '.deploy/blog.deploy.yml'
name: 'BLOG'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
docker_login: ${{ secrets.GHCR_USER }}
docker_password: ${{ secrets.GHCR_PULL_TOKEN }}
docker_registry: 'ghcr.io'