mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-13 21:45:55 +03:00
Merge pull request #2806 from my-code-is-grey/2798-dockerhub
#2798 - DockerHub adjustments
This commit is contained in:
commit
89e4e836c9
57
.dockerignore
Normal file
57
.dockerignore
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# Version control
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.gitattributes
|
||||||
|
|
||||||
|
# CI / GitHub / Docker
|
||||||
|
.github
|
||||||
|
.whitesource
|
||||||
|
.dockerignore
|
||||||
|
|
||||||
|
# Editor / IDE
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
.settings
|
||||||
|
.project
|
||||||
|
.pydevproject
|
||||||
|
.mr.developer.cfg
|
||||||
|
|
||||||
|
# Claude
|
||||||
|
.claude
|
||||||
|
|
||||||
|
# Python build artifacts
|
||||||
|
__pycache__
|
||||||
|
*.py[cod]
|
||||||
|
*.so
|
||||||
|
*.egg
|
||||||
|
*.egg-info
|
||||||
|
build/
|
||||||
|
dist/
|
||||||
|
eggs/
|
||||||
|
parts/
|
||||||
|
var/
|
||||||
|
sdist/
|
||||||
|
develop-eggs/
|
||||||
|
.installed.cfg
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# Test & coverage
|
||||||
|
tests/
|
||||||
|
pytest.ini
|
||||||
|
.coveragerc
|
||||||
|
.coverage
|
||||||
|
.coverage*
|
||||||
|
.tox
|
||||||
|
.cache
|
||||||
|
.pytest_cache
|
||||||
|
nosetests.xml
|
||||||
|
|
||||||
|
# Virtualenv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
.venv/
|
||||||
|
|
||||||
|
# Editor backup files
|
||||||
|
*~
|
||||||
41
.github/workflows/docker-build.yml
vendored
41
.github/workflows/docker-build.yml
vendored
@ -10,12 +10,30 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DOCKERHUB_ORG: ${{ vars.DOCKERHUB_ORG || 'gns3' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for stable release
|
||||||
|
id: ver
|
||||||
|
run: |
|
||||||
|
TAG="${GITHUB_REF_NAME#v}"
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
if echo "$TAG" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||||
|
echo "stable=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "stable=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
if: steps.ver.outputs.stable == 'true'
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
|
if: steps.ver.outputs.stable == 'true'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@ -23,18 +41,21 @@ jobs:
|
|||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
|
if: steps.ver.outputs.stable == 'true'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: docker.io
|
registry: docker.io
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push to GitHub Container Registry
|
- name: Build and push
|
||||||
run: |
|
if: steps.ver.outputs.stable == 'true'
|
||||||
docker build -t ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):latest .
|
uses: docker/build-push-action@v6
|
||||||
docker push ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):latest
|
with:
|
||||||
|
context: .
|
||||||
- name: Build and push to Docker Hub
|
push: true
|
||||||
run: |
|
tags: |
|
||||||
docker build -t gns3/${{ github.event.repository.name }}:latest .
|
${{ env.DOCKERHUB_ORG }}/${{ github.event.repository.name }}:${{ steps.ver.outputs.tag }}
|
||||||
docker push gns3/${{ github.event.repository.name }}:latest
|
${{ env.DOCKERHUB_ORG }}/${{ github.event.repository.name }}:latest
|
||||||
|
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.ver.outputs.tag }}
|
||||||
|
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user