Skip to content

Commit

Permalink
Migrate to GitHub Container Registry (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
wata727 committed Jul 3, 2021
1 parent 5ca6505 commit 8c0d8ff
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: docker

on: pull_request
on:
push:
tags:
- v*.*.*
pull_request:
branches:
- master

jobs:
build:
Expand All @@ -10,7 +16,22 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true
- name: docker build
run: docker build -t terraform-linters/tflint .
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: docker run
run: docker run terraform-linters/tflint -v
run: docker run ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }} -v
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
[![Build Status](https://github.com/terraform-linters/tflint/workflows/build/badge.svg?branch=master)](https://github.com/terraform-linters/tflint/actions)
[![GitHub release](https://img.shields.io/github/release/terraform-linters/tflint.svg)](https://github.com/terraform-linters/tflint/releases/latest)
[![Terraform Compatibility](https://img.shields.io/badge/terraform-%3E%3D%200.12-blue)](docs/user-guide/compatibility.md)
[![Docker Hub](https://img.shields.io/badge/docker-ready-blue.svg)](https://hub.docker.com/r/wata727/tflint/)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-blue.svg)](LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/terraform-linters/tflint)](https://goreportcard.com/report/github.com/terraform-linters/tflint)
[![Homebrew](https://img.shields.io/badge/dynamic/json.svg?url=https://formulae.brew.sh/api/formula/tflint.json&query=$.versions.stable&label=homebrew)](https://formulae.brew.sh/formula/tflint)
Expand Down Expand Up @@ -40,7 +39,7 @@ choco install tflint
Docker:

```console
$ docker run --rm -v $(pwd):/data -t wata727/tflint
$ docker run --rm -v $(pwd):/data -t ghcr.io/terraform-linters/tflint
```

Please note that this Docker image is not suitable for production CI/CD pipelines.
Expand Down

0 comments on commit 8c0d8ff

Please sign in to comment.