Skip to content

update README file

update README file #1

name: Frontend CI
on:
pull_request:
types:
- closed
paths:
- 'frontend/**'
workflow_dispatch:
jobs:
Docker-Buildx:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
-
name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up Git Actions
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git config --global pull.rebase true
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/shodapp-k8s-frontend:${{ github.run_id }}
${{ secrets.DOCKERHUB_USERNAME }}/shodapp-k8s-frontend:latest
- name: Update kubernetes manifests
run: |
git pull origin main
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
sed -i "s|kubectl.kubernetes.io/restartedAt: '.*'|kubectl.kubernetes.io/restartedAt: '$timestamp'|" k8s/frontend/frontend-deployment.yml
git add k8s/frontend/frontend-deployment.yml
git commit -m "Update frontend deployment timestamp for new image" || echo "No changes to commit"
git push origin main