diff --git a/.github/workflows/django-cd.yml b/.github/workflows/django-cd.yml index b612bd0..81e0387 100644 --- a/.github/workflows/django-cd.yml +++ b/.github/workflows/django-cd.yml @@ -3,6 +3,11 @@ name: django-cd on: workflow_call: workflow_dispatch: + inputs: + tag: + description: 'Tag to build against' + required: true + default: 'latest' # Default tag if not provided push: tags: "*" @@ -10,8 +15,16 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10.6 - uses: actions/setup-python@v4 - with: - python-version: '3.10.6' + - name: Checkout code + uses: actions/checkout@v4 + + - name: Login to GitHub Packages + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{ github.repository_owner }} --password-stdin + + - name: Build Docker Image + run: docker build -t docker.pkg.github.com/${{ github.repository }}/anitrend:${{ github.event.inputs.tag }} . + working-directory: . + + - name: Push Docker Image to GitHub Packages + run: docker push docker.pkg.github.com/${{ github.repository }}/anitrend:${{ github.event.inputs.tag }} +