Merge pull request #54 from sundowndev/migrate-to-vite #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image | |
on: | |
push: | |
branches: master | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
if: contains(toJson(github.event.commits), '[action]') == false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Publish to Registry | |
id: publish | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: sundowndev/website | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
tags: 'latest' | |
- name: Install yaml processor | |
run: | | |
wget https://github.com/mikefarah/yq/releases/download/3.4.0/yq_linux_amd64 -O ./yq | |
chmod +x ./yq | |
- name: Commit new image digest | |
env: | |
GITHUB_USER: sundowndev | |
GITHUB_REPO: website | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./yq w ./.deploy/deployment.yaml 'spec.template.spec.containers[0].image' ${{ steps.publish.outputs.digest }} -i | |
git remote set-url origin https://$GITHUB_USER:$GITHUB_TOKEN@github.com/$GITHUB_USER/$GITHUB_REPO.git | |
git config --global user.email "$GITHUB_USER@users.noreply.github.com" | |
git config --global user.name "$GITHUB_USER" | |
git add ./.deploy && git commit -m "deploy: update docker image digest [action]" | |
git pull origin master --rebase | |
git push origin master |