Skip to content

replace builds with github actions #17

replace builds with github actions

replace builds with github actions #17

Workflow file for this run

name: Build and Deploy
on:
push:
branches: ['main', 'dev']
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Log in to GHCR
env:
GHCR_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
echo ${{ secrets.ACCESS_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}/python-scripts:${{ github.sha }} -f Dockerfile .
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}/python-scripts:${{ github.sha }}