-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 1.16 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- main
env:
IMAGE_NAME_BACKEND: ghcr.io/${{ github.repository_owner }}/backend:${{ github.sha }}
IMAGE_NAME_LANDING: ghcr.io/${{ github.repository_owner }}/landing:${{ github.sha }}
IMAGE_NAME_PWA: ghcr.io/${{ github.repository_owner }}/pwa:${{ github.sha }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Get a tag for the images
run: echo "IMAGE_TAG=$(git rev-parse --short HEAD)" >> $env:GITHUB_ENV
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build the backend image
run: docker build -t $IMAGE_NAME_BACKEND:$IMAGE_TAG
- name: Build the landing image
run: docker build -t $IMAGE_NAME_LANDING:$IMAGE_TAG
- name: Build the PWA image
run: docker build -t $IMAGE_NAME_PWA:$IMAGE_TAG
- name: Push the images
run: |
docker push $IMAGE_NAME_BACKEND:$IMAGE_TAG
docker push $IMAGE_NAME_LANDING:$IMAGE_TAG
docker push $IMAGE_NAME_PWA:$IMAGE_TAG