Skip to content

Update main.py to get environment variable #3

Update main.py to get environment variable

Update main.py to get environment variable #3

Workflow file for this run

name: Docker Build
on:
push:
branches: [main]
### Ensures that only one CI task per branch/environment will run at a time ###
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
docker-build:
name: Docker Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Log in to Docker Hub
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push docker image
shell: bash
env:
REGISTRY: dungpham91
REPOSITORY: lint-json-inside-yaml
run: |
TAG_VERSION=$(cat VERSION)
docker build \
-t $REGISTRY/$REPOSITORY:${TAG_VERSION} \
-t $REGISTRY/$REPOSITORY:latest \
-f Dockerfile .
echo "Pushing image to repository..."
docker push $REGISTRY/$REPOSITORY --all-tags