Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing GitHub Actions to reflect the GitHub user + updating some references #26

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open
20 changes: 13 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: build_docker_image

on:
push:
branches: [dev]
branches: [dev, test-github-actions]
paths:
- 'Dockerfile'
- 'requirements.txt'
- '.github/workflows/build.yml'
pull_request:
branches: [dev]
branches: [dev, test-github-actions]
paths:
- 'Dockerfile'
- 'requirements.txt'
Expand All @@ -18,18 +18,24 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quickly googling ERROR: denied: installation not allowed to Write organization package and the suggestion is to update these permissions to write-all as you already have done - so not sure there, but otherwise everything LGTM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still not working, so I need to work more on this!

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Login to GitHub Packages
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest
tags: docker.pkg.github.com/${{ env.OWNER_LC }}/seshat/tests-image:latest
19 changes: 12 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@ name: test_code

on:
push:
branches: [dev]
branches: [dev, test-github-actions]
pull_request:
branches: [dev]
branches: [dev, test-github-actions]

jobs:
test_core:
runs-on: ['ubuntu-latest']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Login to GitHub Packages
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Pull and run Docker image
run: |
docker pull docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest
docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest
docker pull docker.pkg.github.com/${{ env.OWNER_LC }}/seshat/tests-image:latest
docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/${{ env.OWNER_LC }}/seshat/tests-image:latest
- name: Sleep, then check PostgreSQL connectivity
run: |
sleep 10
Expand Down
Loading