Skip to content

Build for Release

Build for Release #13

Workflow file for this run

name: Build for Release
on:
workflow_dispatch:
jobs:
admin:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-admin
git push --set-upstream -f origin release-admin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./admin
file: ./admin/Dockerfile
build-args: |
"BACKEND_HOST=http://portfolio-backend.default.svc.cluster.local:8080"
tags: |
ghcr.io/piny940/portfolio-admin:1.0.${{ github.run_number }}
ghcr.io/piny940/portfolio-admin:latest
app:
runs-on: ubuntu-latest
steps:
- name: Get current datetime
run: echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-app
git push --set-upstream -f origin release-app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./app
file: ./app/Dockerfile
build-args: |
BACKEND_HOST=https://portfolio-backend.piny940.com
BACKEND_TOKEN=${{ secrets.BACKEND_API_TOKEN }}
tags: |
ghcr.io/piny940/portfolio-app:1.0.0-${{ env.TIMESTAMP }}
ghcr.io/piny940/portfolio-app:latest
backend:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-backend
git push --set-upstream -f origin release-backend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./backend
file: ./backend/Dockerfile
tags: |
ghcr.io/piny940/portfolio-backend:1.0.${{ github.run_number }}
ghcr.io/piny940/portfolio-backend:latest
updater:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Create Release Branch
run: |
git switch -c release-updater
git push --set-upstream -f origin release-updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: piny940
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
push: true
context: ./updater
file: ./updater/Dockerfile
build-args: |
BACKEND_HOST=https://portfolio-backend.piny940.com
BACKEND_TOKEN=${{ secrets.BACKEND_API_TOKEN }}
tags: |
ghcr.io/piny940/portfolio-updater:1.0.${{ github.run_number }}
ghcr.io/piny940/portfolio-updater:latest