Build v0.123.7 #494
Workflow file for this run
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: Build action-hugo | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- build* | |
jobs: | |
version: | |
name: Get Build Version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- id: version | |
run: | | |
echo "Github Ref: ${{ github.ref }}" | |
VERSION=${{ github.ref }} | |
echo "Version: ${VERSION#*-}" | |
echo "version=${VERSION#*-}" >> $GITHUB_OUTPUT | |
build_and_push_container: | |
name: Build and push action-hugo container | |
runs-on: ubuntu-latest | |
needs: | |
- version | |
steps: | |
- uses: actions/[email protected] | |
with: | |
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | |
- name: Fetch all | |
run: git fetch --all | |
- name: Remove conflicting tags/branches | |
run: | | |
for T in $(git tag); do | |
if [ "${T}" == "${{ needs.version.outputs.version }}" ]; then | |
git push origin :refs/tags/${{ needs.version.outputs.version }} | |
fi | |
done | |
for B in $(git branch -r); do | |
if [ "${B}" == "origin/release-${{ needs.version.outputs.version }}" ]; then | |
git push origin :release-${{ needs.version.outputs.version }} | |
fi | |
done | |
- name: Download Hugo binary | |
run: | | |
curl -L https://github.com/gohugoio/hugo/releases/download/${{ needs.version.outputs.version }}/hugo_extended_${VERSION#*v}_Linux-64bit.tar.gz --output hugo.tgz | |
tar xf hugo.tgz | |
chmod +x hugo | |
- name: Identify | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Adam Barrett" | |
- name: Create and checkout release branch | |
run: git checkout -b release-${{ needs.version.outputs.version }} | |
- name: Run hugo-scraper | |
run: ./hugo-scraper.sh | |
- name: chmod entrypoint | |
run: chmod +x entrypoint.sh | |
- name: commit action.yml entrypoint.sh and README.md | |
run: | | |
git add action.yml entrypoint.sh README.md | |
git commit -m "Documentation for ${{ needs.version.outputs.version }}" | |
- name: Create version tag | |
run: git tag -af ${{ needs.version.outputs.version }} -m "Version ${{ needs.version.outputs.version }}" | |
- name: Check latest tagging | |
run: | | |
HUGO_VERSION=$(curl https://api.github.com/repos/gohugoio/hugo/tags | jq -r .[0].name) | |
VERSION=${{ needs.version.outputs.version }} | |
if [ ${VERSION} == ${HUGO_VERSION} ]; then | |
git tag -af latest -m "Version ${{ needs.version.outputs.version }}" | |
fi | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- uses: docker/[email protected] | |
with: | |
file: Containerfile | |
tags: ${{ needs.version.outputs.version }} | |
- name: Push release branch and tags | |
run: git push origin release-${{ needs.version.outputs.version }} --tags --force |