test build and push #9
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: build and push | |
on: | |
push: | |
branches: | |
- main | |
- gh-action | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@main | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: set lower case repo_name | |
run: | | |
echo "REPO_NAME_LC=${REPO_NAME,,}" >>${GITHUB_ENV} | |
env: | |
REPO_NAME: '${{ github.event.repository.name }}' | |
- name: 'Build Inventory Image' | |
run: | | |
docker build . -f Dockerfile.base --tag ghcr.io/abnerrizzi/${REPO_NAME}:latest | |
docker push ghcr.io/abnerrizzi/${REPO_NAME}:latest |