Skip to content

Commit

Permalink
🤖 Sync org-wide files to upstream repo (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
exercism-bot authored Mar 8, 2022
1 parent 4f01752 commit dc8f9d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 64 deletions.
5 changes: 0 additions & 5 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@
description: "Make this PR count for hacktoberfest"
color: "ff7518"

# This label can be added to accept PRs as part of Hacktoberfest
- name: "hacktoberfest-accepted"
description: "Make this PR count for hacktoberfest"
color: "ff7518"

# This Exercism-wide label is added to all automatically created pull requests that help migrate/prepare a track for Exercism v3
- name: "v3-migration 🤖"
description: "Preparing for Exercism v3"
Expand Down
65 changes: 16 additions & 49 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,21 @@
name: Push Docker images to DockerHub and ECR
name: Deploy

on:
push:
branches: [main, master]
branches:
- main
workflow_dispatch:

jobs:
multiple-registries:
runs-on: ubuntu-latest

env:
ECR_REGISTRY: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com

steps:
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@154c24e1f33dbb5865a021c99f1318cfebf27b32 # 1.1.1
permissions:
contents: write

- name: Cache Docker layers
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a # 2.1.3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@f3364599c6aa293cdc2b8391b1b56d0c30e45c8a # 1.8.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to ECR
uses: docker/login-action@f3364599c6aa293cdc2b8391b1b56d0c30e45c8a # 1.8.0
with:
registry: ${{ env.ECR_REGISTRY }}
username: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}

- name: Build and push Docker image
uses: docker/build-push-action@0db984c1826869dcd0740ff26ff75ff543238fd9 # 2.2.2
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ github.event.repository.full_name }}:latest
${{ github.event.repository.full_name }}:${{ github.sha }}
${{ env.ECR_REGISTRY }}/${{ github.event.repository.name }}:production
${{ env.ECR_REGISTRY }}/${{ github.event.repository.name }}:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
jobs:
build-and-push-image:
uses: exercism/github-actions/.github/workflows/docker-build-push-image.yml@main
secrets:
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID}}
AWS_REGION: ${{secrets.AWS_REGION}}
AWS_ECR_ACCESS_KEY_ID: ${{secrets.AWS_ECR_ACCESS_KEY_ID}}
AWS_ECR_SECRET_ACCESS_KEY: ${{secrets.AWS_ECR_SECRET_ACCESS_KEY}}
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
18 changes: 8 additions & 10 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ name: Tools

on:
push:
branches: [main]
branches:
- main
paths:
- .github/labels.yml
- .github/workflows/sync-labels.yml
schedule:
- cron: 0 0 1 * *
workflow_dispatch:
schedule:
- cron: 0 0 1 * * # First day of each month

permissions:
issues: write

jobs:
sync-labels:
name: Sync labels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: exercism/github-actions/.github/workflows/labels.yml@main

0 comments on commit dc8f9d4

Please sign in to comment.