-
Notifications
You must be signed in to change notification settings - Fork 34
82 lines (63 loc) · 1.63 KB
/
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
77
78
79
80
81
82
name: Deploy CD
on:
# Run on push on primary branches
push:
branches:
- master
- main
paths:
- '.github/workflows/deploy.yml'
- 'app/**'
- 'docker-compose*.yml'
# Run on manual triggers
workflow_dispatch:
# Set GITHUB_TOKEN permissions for the workflow
permissions:
contents: read
# Set workflow concurrency rules
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
# Build job
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build for production
env:
GITHUB_REPOSITORY_URL: https://github.com/${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
BUILD_CHECK: "false"
run: docker compose -f docker-compose.yml -f docker-compose.cicd.yml build
- name: Copy application files
run: docker compose -f docker-compose.yml -f docker-compose.cicd.yml run --rm app
- name: Chown dist folder to $USER
run: sudo chown -R $USER:$USER ./app/dist
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./app/dist
# Deploy job
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
# Dependencies
needs:
- build
# Set GITHUB_TOKEN permissions for the job
permissions:
pages: write
id-token: write
# Set deployment environment
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4