-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.74 KB
/
github-actions-backend-publish.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
name: Backend publish github actions
run-name: ${{ github.actor }} run monorepo cd for backend 🚀
on:
push:
branches: [main]
jobs:
backend-pipeline:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: marceloprado/[email protected]
id: changed-backend
with:
paths: packages/backend
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Log in to Docker Hub
env:
DOCKER_HUB_USERNAME: ${{secrets.DOCKER_HUB_USERNAME}}
DOCKER_HUB_PASSWORD: ${{secrets.DOCKER_HUB_PASSWORD}}
if: steps.changed-backend.outputs.changed == 'true'
run: |
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
- name: build docker
working-directory: ./packages/backend
if: steps.changed-backend.outputs.changed == 'true'
run: docker build -t ${{secrets.DOCKER_HUB_USERNAME}}/lucia-backend .
- name: publish docker
working-directory: ./packages/backend
if: steps.changed-backend.outputs.changed == 'true'
run: docker push ${{secrets.DOCKER_HUB_USERNAME}}/lucia-backend
- run: echo "🍏 This job's status is ${{ job.status }}."