The following .github workflow script does not update the packages ones deployed on Github packages.
After every deployment, I would like the script to update the packages deployed.
Here is my deploy script. Can someone please let me know how to modify it so a new package is created after every deploy?
name: Continuous Integration and Delivery
on: [ push ]
env:
WEB_IMAGE: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')/web
NGINX_IMAGE: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')/nginx
jobs:
build:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Packages
run: echo ${PERSONAL_ACCESS_TOKEN} | docker login ghcr.io -u ${{ secrets.NAMESPACE }} --password-stdin
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Build images
run: |
docker-compose down -v
docker-compose -f docker-compose.ci.yml build
- name: Push images
run: |
docker push ${{ env.WEB_IMAGE }}
docker push ${{ env.NGINX_IMAGE }}
The github package only stays at the original time the initial push was and does not update the package. And upon inspecting, the code change is the original one and does not change to the new one.
On github actions, it shows that it has been successfully pushed
Here is docker.ci
version: "3.8"
services:
web:
build:
context: ./app
dockerfile: Dockerfile.prod
image: "${WEB_IMAGE}"
command: gunicorn hello_django.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
expose:
- 8000
env_file: .env
nginx:
build:
context: ./nginx
image: "${NGINX_IMAGE}"
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
ports:
- 80:80
depends_on:
- web
volumes:
static_volume:
media_volume:

