diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 554ca44b..6717a1de 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,12 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/r { "name": "covidregionaldata", - "build": { - "dockerfile": "Dockerfile", - // Update VARIANT to pick a specific R version: latest, ... ,4.0.1 , 4.0.0 - "args": { "VARIANT": "latest" }, - "context": ".." - }, + "image": "ghcr.io/epiforecasts/covidregionaldata:master", // Set *default* container specific settings.json values on container create. "settings": { diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml new file mode 100644 index 00000000..5177cf70 --- /dev/null +++ b/.github/workflows/build-image.yaml @@ -0,0 +1,50 @@ + + +name: Create and publish a Docker image + +on: + push: + branches: ['release', 'master'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + + - name: Cancel previous builds if present + uses: n1hility/cancel-previous-runs@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v2 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + file: ./.devcontainer/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index e51ccf81..5e099a4c 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -270,27 +270,3 @@ jobs: git config --local user.name "GitHub Actions" Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)" shell: bash - - push_to_registry: - if: github.ref == 'refs/heads/master' && github.repository == 'epiforecasts/covidregionaldata' - name: Push Docker image to GitHub Packages - runs-on: ubuntu-20.04 - - needs: [R-CMD-check, pkgdown, test-coverage] - - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Login to GitHub Packages - uses: docker/login-action@v1 - with: - registry: docker.pkg.github.com - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Push to GitHub Packages - uses: docker/build-push-action@v2 - with: - context: . - file: .devcontainer/Dockerfile - push: true - tags: docker.pkg.github.com/epiforecasts/covidregionaldata/covidregionaldata:latest diff --git a/DESCRIPTION b/DESCRIPTION index 89ec6f9b..2f1c38d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,6 +25,10 @@ Authors@R: role = "aut", email = "Hamish.Gibbs@lshtm.ac.uk", comment = c(ORCID = "0000-0003-4413-453X")), + person(given = "Hugo", + family = "Gruson", + role = "aut", + comment = c(ORCID = "0000-0002-4094-1476")), person(given = "Sophie", family = "Meakin", role = "ctb", @@ -51,10 +55,6 @@ Authors@R: family = "Boyes", role = "ctb", comment = c(URL = "https://github.com/rboyes")), - person(given = "Hugo", - family = "Gruson", - role = "ctb", - comment = c(ORCID = "0000-0002-4094-1476")), person(given = "Vang", family = "Le", role = "ctb",