Update Dockerfile #12
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
name: Build Image | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login into Github Docker Registery | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Install Shopware-CLI | |
uses: FriendsOfShopware/shopware-cli-action@v1 | |
- name: Make image name small | |
id: image | |
run: | | |
export "name=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest" | |
echo "image=${name,,}" >> ${GITHUB_OUTPUT} | |
- name: Cache Composer | |
id: cache-composer-files | |
uses: actions/cache@v3 | |
with: | |
path: composer-cache-files | |
key: composer-cache-${{ hashFiles('composer.lock') }} | |
- name: Inject Cache | |
uses: reproducible-containers/[email protected] | |
with: | |
cache-source: composer-cache-files | |
cache-target: /root/.composer | |
skip-extraction: ${{ steps.cache-composer-files.outputs.cache-hit }} | |
- name: Generate image | |
run: shopware-cli project docker build ${{ steps.image.outputs.image }} --generate-only | |
- name: Show Dockerfile | |
run: cat Dockerfile | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
provenance: false | |
tags: ${{ steps.image.outputs.image }} |