Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix: upload file to release #18

Merged
merged 9 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'GitHub Actions Mirror'

on:
push:
branches:
- main

jobs:
mirror:
uses: mss-boot-io/mss-boot/.github/workflows/mirror-template.yml@main
secrets:
ssh_private_key: ${{ secrets.ssh_private_key }}
8 changes: 4 additions & 4 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: (prod)Deploy To Cloudflare

on:
workflow_dispatch:
workflow_dispatch:
push:
tags:
- 'v*'
- 'v*.*.*'

jobs:
cicd:
uses: mss-boot-io/mss-boot-admin-antd/.github/workflows/cf.yml@main
with:
env: prod
secrets:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
secrets:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
runs-on: ubuntu-latest
name: Release
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install

- name: Build
run: rm -rf config.prod.* && pnpm build

- name: Pack dist
run: tar -czvf dist.tar.gz dist

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: dist-release
path: dist

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
dist.tar.gz
prerelease: false
body: |
## Pull Image
```shell
docker pull ghcr.io/${{ github.repository }}:${{ github.ref }}

image:
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: dist-release
path: dist
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
tags: |
type=schedule
type=ref,event=tag
type=sha,prefix=,format=long,enable=true,priority=100

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx

COPY dist/ /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ The `mss-boot-io` project has always been developed in the GoLand integrated dev
2. [ant-design-pro](https://github.com/ant-design/ant-design-pro)
3. [gin](https://github.com/gin-gonic/gin)
4. [casbin](https://github.com/casbin/casbin)
5. [spf13/viper](https://github.com/spf13/viper)
6. [gorm](https://github.com/jinzhu/gorm)
7. [gin-swagger](https://github.com/swaggo/gin-swagger)
8. [jwt-go](https://github.com/dgrijalva/jwt-go)
9. [oauth2](https://pkg.go.dev/golang.org/x/oauth2)
5. [gorm](https://github.com/jinzhu/gorm)
6. [gin-swagger](https://github.com/swaggo/gin-swagger)
7. [jwt-go](https://github.com/dgrijalva/jwt-go)
8. [oauth2](https://pkg.go.dev/golang.org/x/oauth2)

## 🔑 License

Expand Down
9 changes: 4 additions & 5 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ npm run start
2. [ant-design-pro](https://github.com/ant-design/ant-design-pro)
3. [gin](https://github.com/gin-gonic/gin)
4. [casbin](https://github.com/casbin/casbin)
5. [spf13/viper](https://github.com/spf13/viper)
6. [gorm](https://github.com/jinzhu/gorm)
7. [gin-swagger](https://github.com/swaggo/gin-swagger)
8. [jwt-go](https://github.com/dgrijalva/jwt-go)
9. [oauth2](https://pkg.go.dev/golang.org/x/oauth2)
5. [gorm](https://github.com/jinzhu/gorm)
6. [gin-swagger](https://github.com/swaggo/gin-swagger)
7. [jwt-go](https://github.com/dgrijalva/jwt-go)
8. [oauth2](https://pkg.go.dev/golang.org/x/oauth2)

## 🔑 License

Expand Down