diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 924701f..357e75a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,19 +1,28 @@ name: Publish Desktop Environment on: [push] +env: + DOCKER_BUILDKIT: 1 jobs: build: runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v2 + + - name: Sanitise Repository Name + run: echo ::set-env name=GITHUB_REPOSITORY::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') + + - name: Sanitise Repository Owner + run: echo ::set-env name=REPOSITORY_OWNER::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') + - name: Push to GitHub Container Registry uses: docker/build-push-action@v1 with: - build_args: BUILDKIT_INLINE_CACHE=1,DESKTOP_ENVIRONMENT_USER=${{ github.actor }} - cache_froms: docker.pkg.github.com/${{ github.repository }}/desktop-environment + build_args: BUILDKIT_INLINE_CACHE=1,DESKTOP_ENVIRONMENT_USER=${{ env.REPOSITORY_OWNER }} + cache_froms: docker.pkg.github.com/${{ env.GITHUB_REPOSITORY }}/desktop-environment dockerfile: docker/Dockerfile - registry: docker.pkg.github.com/${{ github.repository }} + registry: docker.pkg.github.com/${{ env.GITHUB_REPOSITORY }} repository: desktop-environment tag_with_ref: true - username: ${{ github.actor }} + username: ${{ env.REPOSITORY_OWNER }} password: ${{ secrets.GITHUB_TOKEN }}