Skip to content

Commit

Permalink
feat: move to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
orangedeng authored and smallteeths committed Nov 15, 2024
1 parent 45eb9fc commit 6a04d48
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
File renamed without changes.
57 changes: 57 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Push to Master

on:
push:
branches:
- main
- release-*
tags:
- 'v*.*.*' # Matches any tag that starts with 'v' and follows semantic versioning
- 'v*.*.*-rc*'

permissions:
contents: write # This is required for actions/checkout

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/gallium
- name: build
run: |
yarn install
yarn run build
- name: checksum
if: startsWith(github.ref,'regs/tags/')
run: |
sha256sum dist/* > dist/sha256sum.txt
- name: Release
if: startsWith(github.ref,'regs/tags/')
uses: softprops/action-gh-release@v2
with:
files: "dist/*"
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKER_REPO || github.repository }}
tags: |
type=ref,event=tag
type=ref,event=branch
- name: Push dev container
uses: docker/build-push-action@v6
with:
file: Dockerfile
context: .
labels: ${{ steps.meta.outputs.labels }}
tags: "${{ steps.meta.outputs.tags }}"
push: true
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx:stable
COPY dist/* /usr/share/nginx/html
RUN rm /usr/share/nginx/html/index.html

0 comments on commit 6a04d48

Please sign in to comment.