From b6e5675742aea6cf32555ee0a91950c6d9c77eae Mon Sep 17 00:00:00 2001 From: LordNoteworthy Date: Wed, 28 Jul 2021 08:58:47 +1000 Subject: [PATCH] feat: add release workflow --- .github/workflows/build.yaml | 11 +++-------- .github/workflows/release.yaml | 33 +++++++++++++++++++++++++++++++++ VERSION | 1 + package.json | 4 ++-- 4 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release.yaml create mode 100644 VERSION diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a4f6d23..c47a1ca 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,14 +1,9 @@ name: UI CI -on: - push: - branches: [main] - pull_request: - branches: [main] - +on: [push] jobs: yarn-build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: node-version: [14.x] @@ -24,7 +19,7 @@ jobs: - run: yarn build docker-build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..595c6c0 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: UI Release +on: workflow_dispatch +jobs: + docker-release: + runs-on: ubuntu-20.04 + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Generate build version + id: prep + run: | + version=$(cat VERSION) + echo "::set-output name=BUILD_VERSION::${version}" + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: saferwall/ui:latest + tags: | + ${{ env.IMAGE }}:latest + ${{ env.IMAGE }}:${{ steps.prep.outputs.BUILD_VERSION }} diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..60453e6 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v1.0.0 \ No newline at end of file diff --git a/package.json b/package.json index 84ad86d..3fdbb6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "saferui", - "version": "0.1.0", + "name": "saferwall-ui", + "version": "1.0.0", "private": true, "scripts": { "serve": "vue-cli-service serve",