-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and update deprecated Github actions (#4327)
* fix CI
- Loading branch information
Showing
1 changed file
with
47 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,9 +78,11 @@ jobs: | |
path: | | ||
./venv | ||
key: pip-${{ matrix.os }}-${{ hashFiles('./requirements.txt', './dev-requirements.txt', './docs/requirements.txt') }} | ||
key: pip-${{ matrix.os }}-${{ hashFiles('./requirements.txt') }}-${{ hashFiles('./dev-requirements.txt') }}-${{ hashFiles('./docs/requirements.txt') }} | ||
restore-keys: | | ||
pip-${{ matrix.os }}-${{ hashFiles('./requirements.txt', './dev-requirements.txt', './docs/requirements.txt') }} | ||
pip-${{ matrix.os }}-${{ hashFiles('./requirements.txt') }}-${{ hashFiles('./dev-requirements.txt') }}-${{ hashFiles('./docs/requirements.txt') }} | ||
pip-${{ matrix.os }}-${{ hashFiles('./requirements.txt') }}-${{ hashFiles('./dev-requirements.txt') }} | ||
pip-${{ matrix.os }}-${{ hashFiles('./requirements.txt') }} | ||
pip-${{ matrix.os }} | ||
- name: Prepare test env | ||
|
@@ -191,17 +193,26 @@ jobs: | |
|
||
build_docker_image: | ||
name: Build docker image | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build Docker image | ||
run: | | ||
docker build -f ./docker/Dockerfile -t geotrek:latest . | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: "geotrek:latest" | ||
load: true | ||
file: ./docker/Dockerfile | ||
|
||
- name: Upload image | ||
uses: ishworkh/docker-image-artifact-upload@v1 | ||
uses: ishworkh/container-image-artifact-upload@v2.0.0 | ||
with: | ||
image: "geotrek:latest" | ||
|
||
|
@@ -263,12 +274,15 @@ jobs: | |
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download image | ||
uses: ishworkh/docker-image-artifact-download@v1 | ||
uses: ishworkh/container-image-artifact-download@v2.0.0 | ||
with: | ||
image: "geotrek:latest" | ||
|
||
- name: Launch service | ||
run: | | ||
docker tag geotrek:latest geotrekce/admin:latest | ||
|
@@ -349,7 +363,7 @@ jobs: | |
--health-cmd pg_isready | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: 'focal' | ||
|
@@ -414,30 +428,28 @@ jobs: | |
needs: [ test, e2e_docker_image, build_deb, e2e_deb_20_04 ] | ||
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Download 18.04 debian artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bionic | ||
|
||
- name: Download 20.04 debian artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: debian-20-04 | ||
name: focal | ||
|
||
- name: Download docker image | ||
uses: ishworkh/docker-image-artifact-download@v1 | ||
with: | ||
image: focal | ||
- name: Attach debian packages as release binaries | ||
uses: skx/github-action-publish-binaries@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: ishworkh/[email protected] | ||
with: | ||
args: '*.deb' | ||
image: 'geotrek:latest' | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_LOGIN }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Publish Docker image (v2 and latest) | ||
run: | | ||
if [[ "${{ github.ref }}" == *"dev"* ]]; then | ||
|
@@ -449,11 +461,13 @@ jobs: | |
fi | ||
docker tag geotrek:latest geotrekce/admin:$DOCKER_TAG | ||
docker push geotrekce/admin:$DOCKER_TAG | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | ||
|
||
- name: Publish debian packages | ||
run: | | ||
if [[ "${{ github.ref }}" == *"dev"* ]]; then | ||
|
@@ -470,3 +484,15 @@ jobs: | |
ssh -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} make bionic_main -C /srv/packages | ||
ssh -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} make focal_main -C /srv/packages | ||
fi | ||
- name: Download 22.04 debian artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: jammy | ||
|
||
- name: Attach debian packages as release binaries | ||
uses: skx/github-action-publish-binaries@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: '*.deb' |