mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-27 08:00:52 +08:00
.
This commit is contained in:
parent
0c1dff25fb
commit
f3f71a1468
43
.github/workflows/build-publish.yml
vendored
43
.github/workflows/build-publish.yml
vendored
@ -1,43 +0,0 @@
|
||||
name: build-publish
|
||||
|
||||
on:
|
||||
# run it on push to the default repository branch
|
||||
push:
|
||||
branches: [ develop ]
|
||||
# run it during pull request
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
# define job to build and publish docker image
|
||||
build-and-push-docker-image:
|
||||
name: Build Docker image and push to repositories
|
||||
# run only when code is compiling and tests are passing
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# steps to perform in job
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to Github Packages
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t meysamh66/${{ github.repository }}/flight:latest -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" .
|
||||
|
||||
- name: Publish image
|
||||
run: |
|
||||
docker push meysamh66/${{ github.repository }}/flight:latest
|
||||
|
||||
|
||||
40
.github/workflows/github-packages.yml
vendored
Normal file
40
.github/workflows/github-packages.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
name: github-packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ develop ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
build-and-push-docker-image:
|
||||
name: Build and Publish Docker image to Github Packages
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
|
||||
- name: Login to Github Packages
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t ghcr.io/${{ github.repository }}/flight:latest -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" .
|
||||
docker build -t ghcr.io/${{ github.repository }}/identity:latest -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" .
|
||||
docker build -t ghcr.io/${{ github.repository }}/passenger:latest -f "${{ github.workspace }}/src/Services/Passenger/Dockerfile" .
|
||||
docker build -t ghcr.io/${{ github.repository }}/booking:latest -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" .
|
||||
|
||||
- name: Publish image
|
||||
run: |
|
||||
docker push ghcr.io/${{ github.repository }}/flight:latest
|
||||
docker push ghcr.io/${{ github.repository }}/identity:latest
|
||||
docker push ghcr.io/${{ github.repository }}/passenger:latest
|
||||
docker push ghcr.io/${{ github.repository }}/booking:latest
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user