Skip to content

Commit

Permalink
Use github container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxuanjun committed Apr 30, 2024
1 parent 72e7ecc commit f9975c5
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 475 deletions.
44 changes: 32 additions & 12 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,37 @@ on:
jobs:
build:
runs-on: ubuntu-latest

permissions:
packages: write
contents: read

env:
tag: ${{ secrets.CI_REGISTRY }}/geekpie/shanghaitech-mirror-frontend:latest
REGISTRY: ghcr.io
USERNAME: ShanghaitechGeekPie
IMAGE_NAME : ${{ github.repository }}

steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ${{ secrets.CI_REGISTRY }}
username: ${{ secrets.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag $tag
- name: Push the Docker image
run: docker push $tag
- name: Checkout repository
uses: actions/checkout@v3

- name: Login to Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,39 @@
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@farmfe/cli": "^1.0.0",
"@farmfe/core": "^1.0.13",
"@farmfe/cli": "^1.0.1",
"@farmfe/core": "^1.1.2",
"@farmfe/plugin-react": "^1.0.0",
"@fontsource/roboto": "^5.0.12",
"@fontsource/roboto": "^5.0.13",
"@mui/material": "^5.15.15",
"@mui/styles": "^5.15.15",
"@tanstack/react-query": "^5.29.0",
"@tanstack/react-virtual": "^3.2.0",
"@types/markdown-it": "^14.0.0",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@tanstack/react-query": "^5.32.1",
"@tanstack/react-virtual": "^3.5.0",
"@types/markdown-it": "^14.0.1",
"@types/node": "^20.12.7",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"autocorrect-node": "^2.9.0",
"clsx": "^2.1.0",
"core-js": "^3.36.1",
"clsx": "^2.1.1",
"core-js": "^3.37.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-hooks": "^4.6.2",
"glob": "^10.3.12",
"lefthook": "^1.6.8",
"lefthook": "^1.6.10",
"markdown-it": "^14.1.0",
"markdown-it-prism": "^2.3.0",
"mdi-material-ui": "^7.8.0",
"prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-refresh": "^0.14.0",
"react-router-dom": "^6.22.3",
"terser": "^5.30.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-refresh": "^0.14.2",
"react-router-dom": "^6.23.0",
"timeago.js": "^4.0.2",
"typeface-roboto": "^1.1.13",
"typescript": "^5.4.4",
"typescript": "^5.4.5",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-svgr": "^4.2.0"
}
Expand Down
Loading

0 comments on commit f9975c5

Please sign in to comment.