Skip to content

Commit

Permalink
Docker image stable
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Nov 21, 2020
1 parent 383137b commit fd96276
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# From:
# https://www.docker.com/blog/docker-github-actions/
# https://github.com/metcalfc/docker-action-examples

name: Docker image stable

on:
push:
tags:
- '*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Build and push
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./docker
file: ./docker/Dockerfile
build-args: |
PHPSTAN_VERSION=${{ steps.get_version.outputs.VERSION }}
push: true
tags: ghcr.io/phpstan/phpstan:latest,ghcr.io/phpstan/phpstan:0.12,ghcr.io/phpstan/phpstan:${{ steps.get_version.outputs.VERSION }}

0 comments on commit fd96276

Please sign in to comment.