Skip to content

Put nginx in separate repository #38

Put nginx in separate repository

Put nginx in separate repository #38

Workflow file for this run

name: CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install test dependencies
run: pip install flake8
- name: Lint code
run: flake8 --extend-ignore=E501
- name: Install app dependencies
run: pip install -r app/requirements.txt
- name: Run tests
run: python manage.py test
working-directory: app
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images
run: |
ACC=filipmania
IMAGE=${ACC}/urlshortener
docker build --build-arg BUILD=nginx -t ${IMAGE}:${GITHUB_RUN_ID}-nginx -t ${IMAGE}:nginx .
docker push ${IMAGE}:${GITHUB_RUN_ID}-nginx
docker push ${IMAGE}:nginx
- name: Save the IMAGE_TAG
run: echo "IMAGE_TAG=${GITHUB_RUN_ID}"