Skip to content

Update index.html

Update index.html #3

name: build and push docker image
on:
push
jobs:
release-docker:
name: Release docker image
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get git SHA short
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
umairk8s/umairtestrepo2:latest
umairk8s/umairtestrepo2:sha-${{ env.sha_short }}
labels: |
org.opencontainers.image.source=${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Generate deploy manifest from Jinja template
uses: cuchi/[email protected]
with:
template: tmpl/deploy.j2
output_file: deploy/deploy.yaml
strict: true
variables: |
image_deploy_tag=sha-${{ env.sha_short }}
- name: Configure git for the action
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Stash unstaged changes
run: git stash --include-untracked
- name: Pull latest changes from the remote branch
run: git pull origin main --rebase
- name: Apply stashed changes
run: git stash pop || echo "No stashed changes to apply"
- name: Commit deploy manifest on local repo
run: |
git add deploy/deploy.yaml
git commit -s -m "[skip ci] Generate deployment manifests"
- name: Push deploy manifests to remote repo
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main