-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.28 KB
/
7_auth_7_1_express_js.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
name: 7_auth_7_1_express_js
on:
push:
branches:
- master
paths:
- 7_auth/7_1_express_js/**
workflow_dispatch:
env:
APP_NAME: auth_express_js
PROJECT_DIR: 7_auth/7_1_express_js
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- id: lower-credentials
name: Lower Credentials
run: |
echo "actor=${GITHUB_ACTOR@L}" >> $GITHUB_OUTPUT
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ steps.lower-credentials.outputs.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Build Docker image
run: |
cd ${{ env.PROJECT_DIR }} && \
docker build \
--build-arg CLIENT_ID=${{ secrets.OAUTH_GITHUB_CLIENT_ID }} \
--build-arg CLIENT_SECRET=${{ secrets.OAUTH_GITHUB_CLIENT_SECRET }} \
-t ghcr.io/${{ steps.lower-credentials.outputs.repository }}/${{ env.APP_NAME }}:latest .
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/${{ steps.lower-credentials.outputs.repository }}/${{ env.APP_NAME }}:latest