Add --add-host to resolve forgejo hostname in job containers
The job containers cannot resolve 'forgejo' Docker hostname. Added 'options: --add-host=forgejo:10.100.0.2' to all container blocks. This adds an entry to /etc/hosts mapping forgejo to the reachable IP.
This commit is contained in:
@@ -15,8 +15,7 @@ jobs:
|
|||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -36,8 +35,7 @@ jobs:
|
|||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -55,8 +53,7 @@ jobs:
|
|||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
|
|||||||
@@ -8,15 +8,13 @@ on:
|
|||||||
env:
|
env:
|
||||||
REGISTRY: ${{ vars.REGISTRY || '10.100.0.2:3000' }}
|
REGISTRY: ${{ vars.REGISTRY || '10.100.0.2:3000' }}
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
FORGEJO_URL: ${{ vars.FORGEJO_URL || 'http://10.100.0.2:3000' }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ env.FORGEJO_URL }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -36,8 +34,7 @@ jobs:
|
|||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ env.FORGEJO_URL }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -55,8 +52,7 @@ jobs:
|
|||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ env.FORGEJO_URL }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -76,8 +72,7 @@ jobs:
|
|||||||
needs: [lint, test, type-check]
|
needs: [lint, test, type-check]
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
env:
|
options: --add-host=forgejo:10.100.0.2
|
||||||
GITHUB_SERVER_URL: ${{ env.FORGEJO_URL }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -107,8 +102,8 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
options: --add-host=forgejo:10.100.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_SERVER_URL: ${{ env.FORGEJO_URL }}
|
|
||||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
DEPLOY_USER: ${{ secrets.DEPLOY_USER || 'deploy' }}
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER || 'deploy' }}
|
||||||
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT || '22' }}
|
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT || '22' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user