File tree Expand file tree Collapse file tree 1 file changed +15
-25
lines changed Expand file tree Collapse file tree 1 file changed +15
-25
lines changed Original file line number Diff line number Diff line change 1- name : PC React CI
1+ name : Build
22
33on :
44 push :
88
99jobs :
1010
11- build :
12-
11+ build_and_push :
12+ name : Build and Push Docker image
1313 runs-on : ubuntu-latest
14-
14+ permissions :
15+ packages : write
16+ contents : read
1517 steps :
16- - name : Checkout code
17- uses : actions/checkout@v3
18-
19- - name : Build image
20- id : build
21- run : |
22- docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ secrets.DOCKER_REGISTRY }}
23- export BUILD_TAG=${{ secrets.DOCKER_REGISTRY }}/cinch/pc-react:$(date +%s)
24- echo "tag=$BUILD_TAG" >> $GITHUB_OUTPUT
25- docker build . -f Dockerfile --tag $BUILD_TAG
26- docker push $BUILD_TAG
18+ - name : Check out the repo
19+ uses : actions/checkout@v4
2720
28- - name : Run container
29- uses : appleboy/ssh-action@v0.1.7
30- with :
31- host : ${{ secrets.SEVER_HOST }}
32- username : ${{ secrets.SEVER_USERNAME }}
33- password : ${{ secrets.SEVER_PASSWORD }}
34- port : ${{ secrets.SEVER_PORT }}
35- script : |
36- export PC_REACT_TAG=${{ steps.build.outputs.tag }}
37- ${{ secrets.RUN_SCRIPT }}
21+ - name : Build and publish a Docker image for ${{ github.repository }}
22+ uses : macbre/push-to-ghcr@master
23+ with :
24+ image_name : ${{ github.repository }} # it will be lowercased internally
25+ github_token : ${{ secrets.GITHUB_TOKEN }}
26+ dockerfile : ./Dockerfile
27+ image_tag : latest
You can’t perform that action at this time.
0 commit comments