forked from Tencent/tdesign-react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: PC React CI | ||
name: Build | ||
|
||
on: | ||
push: | ||
|
@@ -8,30 +8,20 @@ on: | |
|
||
jobs: | ||
|
||
build: | ||
|
||
build_and_push: | ||
name: Build and Push Docker image | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build image | ||
id: build | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ secrets.DOCKER_REGISTRY }} | ||
export BUILD_TAG=${{ secrets.DOCKER_REGISTRY }}/cinch/pc-react:$(date +%s) | ||
echo "tag=$BUILD_TAG" >> $GITHUB_OUTPUT | ||
docker build . -f Dockerfile --tag $BUILD_TAG | ||
docker push $BUILD_TAG | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run container | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SEVER_HOST }} | ||
username: ${{ secrets.SEVER_USERNAME }} | ||
password: ${{ secrets.SEVER_PASSWORD }} | ||
port: ${{ secrets.SEVER_PORT }} | ||
script: | | ||
export PC_REACT_TAG=${{ steps.build.outputs.tag }} | ||
${{ secrets.RUN_SCRIPT }} | ||
- name: Build and publish a Docker image for ${{ github.repository }} | ||
uses: macbre/push-to-ghcr@master | ||
with: | ||
image_name: ${{ github.repository }} # it will be lowercased internally | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
dockerfile: ./Dockerfile | ||
image_tag: latest |