Skip to content

Commit

Permalink
fix firebasee build
Browse files Browse the repository at this point in the history
  • Loading branch information
fusionstrings committed Apr 6, 2021
1 parent 71bde12 commit 3b55e1c
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 148 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# This is a basic workflow to help you get started with Actions

name: CI
name: Deploy Cloudflare Workers

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the creation branch
push:
branches: [ creation, river ]
branches: [ creation ]
pull_request:
branches: [ creation, river ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cloud-run-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

on: pull_request

name: Build and Deploy a Container on pull_request
name: GCR Build and Deploy a Container on pull_request
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
SERVICE: chitrkatha-${{ github.event.number }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-cloud-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
on:
push:
branches:
- river
- [ creation ]

name: Build and Deploy a Container
name: GCR Build and Deploy a Container
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
SERVICE: chitrkatha
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/docker-publish-2.yml

This file was deleted.

118 changes: 56 additions & 62 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,70 @@
name: Docker
name: docker publish

on:
# Triggers the workflow on push or pull request events but only for the creation branch
push:
# Publish `creation` as Docker `latest` image.
branches:
- creation

# Publish `v1.2.3` tags as releases.
- '**'
tags:
- v*

# Run tests for any PRs.
- 'v*.*.*'
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
# TODO: Change variable to your image's name.
IMAGE_NAME: fusionstrings/chitrkatha

jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test

docker:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "creation" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
# list of Docker images to use as base name for tags
images: |
${{ env.IMAGE_NAME }}
ghcr.io/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
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:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- river
- [ creation ]
jobs:
build_and_deploy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hayd/deno:alpine-1.8.2
FROM hayd/deno:alpine-1.8.3

EXPOSE 1729

Expand Down
6 changes: 3 additions & 3 deletions src/components/chitrkatha.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import { onMount } from 'svelte'
import Header from './components/chitrkatha/header.svelte'
import Main from './components/chitrkatha/main.svelte'
import Footer from './components/chitrkatha/footer.svelte'
import Header from './chitrkatha/header.svelte'
import Main from './chitrkatha/main.svelte'
import Footer from './chitrkatha/footer.svelte'
onMount(() => {
if ('serviceWorker' in navigator) {
Expand Down
8 changes: 4 additions & 4 deletions src/components/xkcd.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script>
import { onMount } from 'svelte'
import fetchComics from './functions/xkcd.js'
import Header from './components/xkcd/header.svelte'
import Main from './components/xkcd/main.svelte'
import Footer from './components/xkcd/footer.svelte'
import fetchComics from '../functions/xkcd.js'
import Header from './xkcd/header.svelte'
import Main from './xkcd/main.svelte'
import Footer from './xkcd/footer.svelte'
const url = new URL(window.location)
const page = url.searchParams.get('page') || 1
Expand Down

1 comment on commit 3b55e1c

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 3b55e1c Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

relative import path "http/server.ts" not prefixed with / or ./ or ../ Imported from "https://raw.githubusercontent.com/fusionstrings/chitrkatha/3b55e1c5bb49612a76a2716c042b5cdcb9bb7fca/deps.ts"

Please sign in to comment.