-
-
Notifications
You must be signed in to change notification settings - Fork 21
41 lines (31 loc) · 1.35 KB
/
deploy-explorer-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy Explorer to Docker Hub
on:
release:
types: [ published ]
env:
BUILD_DIR: Tools/GbxExplorerOld/Server
IMAGE_NAME: gbx-explorer
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set lowercase repository_owner and tag_name without v
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
echo "VERSION=${TAG#v}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
TAG: '${{ github.event.release.tag_name }}'
- name: Build Docker Image
run: docker build . -f $BUILD_DIR/Dockerfile -t ghcr.io/$OWNER_LC/$IMAGE_NAME -t ghcr.io/$OWNER_LC/$IMAGE_NAME:$VERSION -t ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME -t ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$VERSION
- name: Push the Docker image to ghcr.io
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
docker push ghcr.io/$OWNER_LC/$IMAGE_NAME:$VERSION
docker push ghcr.io/$OWNER_LC/$IMAGE_NAME
- name: Push the Docker image to hub.docker.com
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
docker push ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$VERSION
docker push ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME