Update Dockerfile #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image push to registry | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
BUILD_DIR: Src/BigBang1112.Gbx/Server | |
IMAGE_NAME: gbx-bigbang1112-cz | |
REGISTRY_URL: ${{ secrets.REGISTRY_URL }} | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build Docker image | |
run: docker build . -f $BUILD_DIR/Dockerfile -t $REGISTRY_URL/$IMAGE_NAME --build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
- name: Push Docker image to registry | |
run: | | |
echo ${{ secrets.REGISTRY_PASSWORD }} | docker login $REGISTRY_URL --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin | |
docker push $REGISTRY_URL/$IMAGE_NAME |