fix: ubuntu-latest jobs with host network, self-hosted for deploy
This commit is contained in:
+15
-10
@@ -7,11 +7,16 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
@@ -23,21 +28,21 @@ jobs:
|
|||||||
|
|
||||||
build-push:
|
build-push:
|
||||||
needs: lint-test
|
needs: lint-test
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build image
|
- name: Set up Docker Buildx
|
||||||
run: |
|
uses: docker/setup-buildx-action@v3
|
||||||
docker build -t localhost:5000/admin/hello-world:${{ github.sha }} .
|
|
||||||
docker tag localhost:5000/admin/hello-world:${{ github.sha }} localhost:5000/admin/hello-world:latest
|
|
||||||
|
|
||||||
- name: Push to registry
|
- name: Build and push
|
||||||
run: |
|
uses: docker/build-push-action@v6
|
||||||
docker push localhost:5000/admin/hello-world:${{ github.sha }}
|
with:
|
||||||
docker push localhost:5000/admin/hello-world:latest
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: localhost:5000/admin/hello-world:${{ github.sha }},localhost:5000/admin/hello-world:latest
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build-push
|
needs: build-push
|
||||||
|
|||||||
Reference in New Issue
Block a user