-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.02 KB
/
build-and-push-image.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
name: Build and push images
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-n-push:
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- run: pnpm install
- run: pnpm run build
env:
NUXT_PUBLIC_STUDIO_TOKENS: ${{ vars.NUXT_PUBLIC_STUDIO_TOKENS }}
NUXT_PUBLIC_SITE_URL: ${{ vars.NUXT_PUBLIC_SITE_URL }}
- name: Build the Docker image
run: docker build -t minhhikari/hikari-aniblog:latest .
- name: Push the "latest" image
run: docker push "minhhikari/hikari-aniblog:latest"