Skip to content

Commit

Permalink
Further cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt authored Dec 20, 2023
1 parent ecb5224 commit 719817f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 51 deletions.
101 changes: 51 additions & 50 deletions .github/workflows/dea-intertidal-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
branches:
- main
- tests
# paths:
# - 'intertidal/**'
# - 'data/**'
# - '.github/workflows/dea-intertidal-image.yml'
# - 'Dockerfile'
# - 'requirements.in'
# - 'setup.py'
# - 'docker-compose.yml'
# - 'tests/run_tests'
paths:
- 'intertidal/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/dea-intertidal-image.yml'
- 'Dockerfile'
- 'requirements.in'
- 'setup.py'
- 'docker-compose.yml'

release:
types: [created, edited, published]
Expand All @@ -41,9 +41,10 @@ jobs:
run: |
docker-compose build
- name: Run dockerized integration tests
- name: Run tests
run: |
# TEMPORARY: Download tide modelling files and unzip
# Download tide modelling files and unzip
# TODO: Replace with S3 sync from dea-non-public-data
wget --no-verbose https://www.dropbox.com/s/uemd8ib2vfw5nad/tide_models.zip?dl=1 -O tide_models.zip
unzip -q tide_models.zip
Expand All @@ -58,42 +59,42 @@ jobs:
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1

# push_ecr:
# needs: [test]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# role-to-assume: arn:aws:iam::538673716275:role/github-actions-role
# aws-region: ap-southeast-2

# - name: Get tag for this build if it exists
# if: github.event_name == 'release'
# run: |
# echo "RELEASE=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV

# - name: Push release image to ECR
# uses: whoan/docker-build-with-cache-action@master
# if: github.event_name == 'release'
# with:
# registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com
# image_name: ${{ env.IMAGE_NAME }}
# image_tag: ${{ env.RELEASE }}

# - name: Get git commit hash for push to main
# if: github.event_name != 'release'
# run: |
# echo "TAG=dev$(git rev-parse --short HEAD)" \
# >> $GITHUB_ENV

# - name: Push unstable image to ECR
# uses: whoan/docker-build-with-cache-action@master
# if: github.event_name != 'release'
# with:
# registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com
# image_name: ${{ env.IMAGE_NAME }}
# image_tag: latest,${{ env.TAG }}
push_ecr:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::538673716275:role/github-actions-role
aws-region: ap-southeast-2

- name: Get tag for this build if it exists
if: github.event_name == 'release'
run: |
echo "RELEASE=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV
- name: Push release image to ECR
uses: whoan/docker-build-with-cache-action@master
if: github.event_name == 'release'
with:
registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com
image_name: ${{ env.IMAGE_NAME }}
image_tag: ${{ env.RELEASE }}

- name: Get git commit hash for push to main
if: github.event_name != 'release'
run: |
echo "TAG=dev$(git rev-parse --short HEAD)" \
>> $GITHUB_ENV
- name: Push unstable image to ECR
uses: whoan/docker-build-with-cache-action@master
if: github.event_name != 'release'
with:
registry: 538673716275.dkr.ecr.ap-southeast-2.amazonaws.com
image_name: ${{ env.IMAGE_NAME }}
image_tag: latest,${{ env.TAG }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![DOI](https://img.shields.io/badge/DOI-10.1016/j.ecss.2019.03.006-0e7fbf.svg)](https://doi.org/10.1016/j.ecss.2019.03.006)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![codecov](https://codecov.io/gh/GeoscienceAustralia/dea-intertidal/branch/tests/graph/badge.svg?token=7HXSIPGT5I)](https://codecov.io/gh/GeoscienceAustralia/dea-intertidal)
[![codecov](https://codecov.io/gh/GeoscienceAustralia/dea-intertidal/branch/main/graph/badge.svg?token=7HXSIPGT5I)](https://codecov.io/gh/GeoscienceAustralia/dea-intertidal)
[![example workflow](https://github.com/GeoscienceAustralia/dea-intertidal/actions/workflows/dea-intertidal-image.yml/badge.svg)](https://github.com/GeoscienceAustralia/dea-intertidal/actions/workflows/dea-intertidal-image.yml)

**License:** The code in this repository is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). Digital Earth Australia data is licensed under the [Creative Commons by Attribution 4.0 license](https://creativecommons.org/licenses/by/4.0/).
Expand Down

0 comments on commit 719817f

Please sign in to comment.