Skip to content

Update Dockerfile remove coder dir #48

Update Dockerfile remove coder dir

Update Dockerfile remove coder dir #48

name: Publish Docker image
# To MaastrichtU-IDS GitHub Container Registry
# https://github.com/orgs/MaastrichtU-IDS/packages
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'Dockerfile'
- '.github/workflows/publish-docker.yml'
schedule:
- cron: '0 3 * * 1'
# Monday at 3:00 GMT+1
env:
IMAGE_NAME: code-server
jobs:
# Build and push image to ghcr.io
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into GitHub Container Registry
# TODO: Create a token with `read:packages` and `write:packages` scopes
# And save it as an Actions secret CONTAINER_REGISTRY_GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION