Update main.yml #13
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: main | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Build | |
run: | | |
version=`git describe --tags` | |
npm i | |
npm run build | |
cd dist | |
zip -r headscale-ui-${{ github.ref_name }}.zip headscale-ui | |
- name: Create GitHub release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: ${{ env.ReleaseVersion }} | |
title: ${{ env.ReleaseVersion }} | |
prerelease: false | |
files: | | |
dist/headscale-ui-${{ github.ref_name }}.zip | |
- name: Create Docker File | |
run: | | |
echo "FROM nginx:alpine" > Dockerfile | |
echo "COPY dist/headscale-ui /usr/share/nginx/html/manager" >> Dockerfile | |
echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile | |
pwd | |
cat Dockerfile | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: simcu/headscale-ui | |
labels: latest ${{ github.ref_name }} |