mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Docker build CI/CD pipeline
This commit is contained in:
parent
add8c4e8a2
commit
020f6a123d
39
.github/workflows/docker-build.yml
vendored
Normal file
39
.github/workflows/docker-build.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master, enhancement/**, dev ]
|
||||
pull_request:
|
||||
branches: [ main, master, enhancement/**, dev ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: docker.io
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push to GitHub Container Registry
|
||||
run: |
|
||||
docker build -t ghcr.io/${{ github.repository }}:latest .
|
||||
docker push ghcr.io/${{ github.repository }}:latest
|
||||
|
||||
- name: Build and push to Docker Hub
|
||||
run: |
|
||||
docker build -t ${{ github.repository }}:latest .
|
||||
docker push ${{ github.repository }}:latest
|
||||
Loading…
x
Reference in New Issue
Block a user