-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (46 loc) · 1.46 KB
/
secrets.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
name: Using Secrets
on:
push:
branches:
- using-secrets
env:
DB_NAME: "my-db"
jobs:
test-env-vars:
environment: test
runs-on: ubuntu-latest
steps:
- name: test environment variables
run: |
echo "ENV var from yaml env conf - 1" - $DB_NAME
echo "ENV var from yaml env conf - 2" - ${{env.DB_NAME}}
echo "ENV var from github environment settings" - ${{vars.ENV_DB_NAME}}
test-env-secrets:
environment: test
runs-on: ubuntu-latest
steps:
- name: test environment secrets
run: |
echo "ENV secrets from github environment settings" - ${{secrets.MY_SECRET}}
echo "Above echo will not print the value, since secret is actually a secret and not exposed anywhere"
build:
env:
DB_NAME: ${{ secrets.MY_SECRET }}
runs-on: ubuntu-latest
steps:
- name: Get Code
uses: actions/checkout@v4
- name: Folder content
working-directory: ./nodejs-demo
run: ls
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: deps-node-modules-${{ hashFiles('./nodejs-demo/package-lock.json') }}
- name: Install dependencies
working-directory: ./nodejs-demo
run: npm ci
- name: Build
working-directory: ./nodejs-demo
run: npm start