feat(docker): add prebuilt images
This commit is contained in:
parent
425a08432b
commit
fc5e35b1b1
3 changed files with 48 additions and 1 deletions
46
.github/workflows/docker-build.yaml
vendored
Normal file
46
.github/workflows/docker-build.yaml
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
name: Build & Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract version from release tag
|
||||
if: github.event_name == 'release'
|
||||
id: version
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push Docker image
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
run: |
|
||||
docker build -f backend.dockerfile -t itzcrazykns1337/perplexica-backend:main .
|
||||
docker build -f app.dockerfile -t itzcrazykns1337/perplexica-frontend:main .
|
||||
docker push itzcrazykns1337/perplexica-backend:main
|
||||
docker push itzcrazykns1337/perplexica-frontend:main
|
||||
|
||||
- name: Build and push release Docker image
|
||||
if: github.event_name == 'release'
|
||||
run: |
|
||||
docker build -f backend.dockerfile -t itzcrazykns1337/perplexica-backend:${{ env.RELEASE_VERSION }} .
|
||||
docker build -f app.dockerfile -t itzcrazykns1337/perplexica-frontend:${{ env.RELEASE_VERSION }} .
|
||||
docker push itzcrazykns1337/perplexica-backend:${{ env.RELEASE_VERSION }}
|
||||
docker push itzcrazykns1337/perplexica-frontend:${{ env.RELEASE_VERSION }}
|
Loading…
Add table
Add a link
Reference in a new issue