Merge pull request #1399 from sundowndev/fix/docker-build #24
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: release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/[email protected] | |
with: | |
node-version: 20.3.1 | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
go-version: 1.20.6 | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Building static assets | |
run: (cd web/client && yarn install --immutable && yarn build) | |
- name: Install tools | |
run: make install-tools | |
- name: Run GoReleaser | |
uses: goreleaser/[email protected] | |
with: | |
version: v1.10.2 | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
docker: | |
runs-on: ubuntu-latest | |
if: contains(toJson(github.event.commits), '[action]') == false | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: sundowndev/phoneinfoga:latest,sundowndev/phoneinfoga:v2,sundowndev/phoneinfoga:stable,sundowndev/phoneinfoga:${{ github.ref_name }} | |
platforms: linux/amd64 # ,linux/arm/v7,linux/arm64 - TODO(sundowndev): enable arm support back | |
publish-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Python 3.8 | |
uses: actions/[email protected] | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install mkdocs==1.3.0 mkdocs-material==8.3.9 mkdocs-minify-plugin==0.5.0 mkdocs-redirects==1.1.0 | |
- name: Deploy | |
run: | | |
git remote set-url origin https://${{ secrets.GITHUB_USER }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ secrets.GITHUB_USER }}/phoneinfoga.git | |
git config --global user.email "${{ secrets.GITHUB_USER }}@users.noreply.github.com" | |
git config --global user.name "${{ secrets.GITHUB_USER }}" | |
mkdocs gh-deploy --force |