-
-
Notifications
You must be signed in to change notification settings - Fork 12
68 lines (46 loc) · 1.86 KB
/
continuous_delivery.yml
File metadata and controls
68 lines (46 loc) · 1.86 KB
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
name: Workflow for CD Delivery for testers with github actions
on:
release:
types: [published]
workflow_dispatch: # trigger the worflow manually
env:
# These secrets key must be created on github repository
#Go to your github repository - Go to Settings - Select Actions secrets - Create
REGISTRY: ghcr.io #github container repository
IMAGE_NAME: ${{ github.actor }}/youtube_ecommerce_docker_image:latest
jobs:
Deploy:
name: Deliver docker image to Container registry
runs-on: ubuntu-latest
#Add rights to create image on registry
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: npm install
- name: Build project
run: npm run build
- name: Log in the container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Publish
run: |
docker build . --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}