Update ci-pipeline.yml #79
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: "CI Pipeline" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' # Specify your desired Python version | ||
- name: Build Docker Image | ||
run: | | ||
docker build -t emmylong1/devops-interview:v1 . | ||
env: | ||
DOCKER_BUILDKIT: 1 # Enable Docker BuildKit for improved build performance | ||
- name: Push to Docker Hub | ||
run: | | ||
echo "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin | ||
docker push emmylong1/devops-interview:v1 | ||
codeql: | ||
name: CodeQL | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '39 23 * * 1' | ||
jobs: | ||
analyze: | ||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} | ||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} | ||
permissions: | ||
security-events: write | ||
actions: read | ||
contents: read | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" | ||
queries: security-and-quality,code-scanning |