-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (48 loc) · 1.41 KB
/
docker.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
name: Build and Publish the Docker Image
on:
push:
branches:
- main
env:
GITHUB_SHA: ${{ github.sha }}
IMAGE: ssr
REGISTRY_HOSTNAME: ghcr.io
NODE_ENV: production
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install Dependencies
run: yarn install --production=false
- name: Build API
run: yarn build
- name: Prune Dev Dependencies
run: npm prune --production
- name: Build Docker Image
run: |
docker build \
-t "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
- name: Publish Docker Image
run: |
docker push "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE"
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: cytoid
directory: ./.nuxt/dist/client
gitHubToken: ${{ secrets.GITHUB_TOKEN }}