Skip to content

Autorun script

Autorun script #45

Workflow file for this run

name: Build App Docker
on:
push:
paths:
- "Dockerfile"
- ".github/workflows/build-docker.yml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Convert repository name to lower case
id: LowCaseRepoName
run: echo "REPO=$(echo ${{ github.repository }} | awk '{print tolower($0)}')" >> $GITHUB_ENV
- name: Setup Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Checkout code
run: |
git clone https://github.com/${{ github.repository }} .
git checkout ${{ github.sha }}
- name: Build docker image
run: |
cd ${{ github.workspace }}
docker build -t ghcr.io/$REPO/app-image:latest .
- name: Login to GH registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Push Docker image
run: |
docker push ghcr.io/$REPO/app-image:latest