Skip to content

Exploring variables and secrets #3

Exploring variables and secrets

Exploring variables and secrets #3

name: Exploring variables and secrets
on: workflow_dispatch
# schedule:
# - cron: "*/1 * * * *"
env:
IMAGENAME: NGINX
CONTAINER_REGISTRY: docker.io
jobs:
Docker:
runs-on: ubuntu-latest
steps:
- name: Docker build
run: echo docker build -t docker.io/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest
- name: Docker login
run: echo docker login --username=${{ vars.DOCKERUSERNAME }} --password=${{ secrets.PASS }}
- name: Docker publish
run: echo docker push $CONTAINER_REGISTRY/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest
Deploy:
runs-on: ubuntu-latest
steps:
- name: Docker run
run: |
docker run -d -p 8080:80 $CONTAINER_REGISTRY/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest
sleep 600s